*** thomas has quit (None) | 10:49 | |
*** tboimah has quit (Remote host closed the connection) | 11:43 | |
*** scooper has quit (Quit: Leaving) | 12:03 | |
*** fkoikoi has quit (Ping timeout: 480 seconds) | 12:21 | |
mulbah | Hello | 12:44 |
---|---|---|
ubuntourist | mulbah, hello | 13:02 |
mulbah | Hello Mr. Cole | 13:02 |
mulbah | How are you doing | 13:03 |
ubuntourist | mulbah, are we expecting tboimah and scooper? | 13:03 |
ubuntourist | mulbah, I'm quite well. Happy making lots of music in recent days. How are you doing? | 13:03 |
mulbah | I am not feeling too well | 13:04 |
mulbah | they will soon turn online | 13:04 |
ubuntourist | Oh... I will try to go slow then. I hope you feel better soon. | 13:05 |
mulbah | Thanks | 13:05 |
mulbah | but I got it working | 13:05 |
mulbah | the ssh key | 13:05 |
mulbah | ssh XDzDRgNPU2GnKewuqVXVCFnxK@lon1.tmate.io | 13:05 |
ubuntourist | Yes, I checked this morning approximately one hour ago, and saw that everyone appeared to have the | 13:06 |
ubuntourist | right files. | 13:06 |
mulbah | okay | 13:07 |
ubuntourist | mulbah, I think, if possible, I'd like to do the "ssh" to the students.mcssliberia.org server. | 13:07 |
mulbah | why | 13:08 |
mulbah | It's cool | 13:08 |
ubuntourist | Well, that's the system that you will all be administering. But if it's simpler, we can continue with yours. | 13:09 |
ubuntourist | But, I am hoping that tmate can be installed quickly. Is it only | 13:09 |
ubuntourist | sudo apt install tmate | 13:10 |
ubuntourist | or did you also | 13:10 |
mulbah | that is my system tmate link i send you | 13:10 |
ubuntourist | sudo apt install tmate-ssh-server | 13:10 |
mulbah | should I run the command on my terminal | 13:11 |
ubuntourist | Yes, I know. But in order to install tmate on the MCSS server, is it only tmate installed? Or is it tmate-ssh-server installed as well? | 13:11 |
ubuntourist | (We can't use tmate on MCSS until it is installed, and I see there are two packages with "tmate" in the name. "tmate" and "tmate-ssh-server". | 13:12 |
ubuntourist | I am asking if you installed both on your computer or only one? | 13:13 |
ubuntourist | Hold. | 13:13 |
mulbah | only one | 13:13 |
ubuntourist | ok. So just tmate. Got it. | 13:14 |
mulbah | yeah | 13:14 |
ubuntourist | I was hoping to wait for our two other colleages to show up so that I don't need to repeat everything three times. | 13:20 |
ubuntourist | But maybe we should just start and they can read the logs, and get info from you later. | 13:20 |
mulbah | should | 13:21 |
mulbah | *sure* | 13:21 |
ubuntourist | Hold on one second more. I need to take care of something on my computer. It will only be a short delay. | 13:21 |
mulbah | ACTION is waiting | 13:22 |
ubuntourist | OK. Back now. | 13:23 |
mulbah | Alright | 13:24 |
ubuntourist | When you start a shared session on your computer, what do you type? Just "tmate"? And it provides the ssh command? | 13:24 |
ubuntourist | OK. | 13:26 |
mulbah | alright | 13:27 |
ubuntourist | Let's start with a way to make logging into MCSS server even easier. | 13:27 |
ubuntourist | You can create abbreviations for all the computers that you ssh to. | 13:28 |
ubuntourist | Type: | 13:28 |
ubuntourist | nano .ssh/conifig | 13:28 |
mulbah | should I ssh into the server before doing it | 13:29 |
ubuntourist | No. We're setting up something on YOUR compuer that will make it easier to SSH to the server. | 13:30 |
ubuntourist | So tboimah and scooper will need to do it on their computers also. | 13:30 |
mulbah | I can now ssh into the server without password | 13:30 |
mulbah | and I show the other it | 13:30 |
mulbah | let me show you | 13:31 |
ubuntourist | I know. But the file I want to create will be for you. | 13:31 |
mulbah | what do you mean | 13:31 |
ubuntourist | Right now, you have to type "ssh mulbah@students.mcssliberia.org". What if we can set it up so that "ssh mcss" is all you need to type? | 13:33 |
mulbah | oh | 13:34 |
mulbah | that is cool | 13:34 |
ubuntourist | (or "ssh liberia" or "ssh server" or whatever you want. All of them can go to "mulbah@students.mcssliberia.org" | 13:34 |
mulbah | Mr. Cole I was thinking of some thing | 13:34 |
ubuntourist | But the file lives on YOUR computer -- because if scooper tries "ssh mcss" we don't want it to try "mulbah@..." we want his to use "scooper@..." | 13:35 |
ubuntourist | OK, go ahead. What are you thinking? | 13:35 |
mulbah | like naming a Variable MCSS and giving it a value mulbah@students.mcssliberia.org | 13:37 |
mulbah | and instill of typing ssh mulbah@students.mcssliberia.org i just type ssh $MCSS | 13:39 |
mulbah | will it work? | 13:39 |
ubuntourist | Good thought. That WILL work. You would add the variable in your ~/.profile and you would need to log out of your terminal and log in again... But there's a better way. | 13:39 |
mulbah | okay | 13:41 |
ubuntourist | So, Start with: | 13:42 |
ubuntourist | nano .ssh/config | 13:42 |
ubuntourist | This is SSH's configuration file. | 13:43 |
ubuntourist | Let's start by adding a comment to the top. | 13:43 |
mulbah | what should I type for the comment | 13:43 |
ubuntourist | # Last modified by Mulbah K <your-email-here> 2023.07.14 (mk) | 13:44 |
mulbah | okay | 13:44 |
ubuntourist | (You can put your full last name and e-mail address in. | 13:44 |
ubuntourist | My personal file starts with the line: | 13:45 |
ubuntourist | # Last modified by Kevin Cole <kjcole@gallaudet.edu> 2022.11.05 (kjc) | 13:45 |
ubuntourist | No. It should be an e-mail address. Not your ssh login. | 13:46 |
ubuntourist | It is a comment. If someone else looks at the file, they should have a way to contact you. | 13:47 |
mulbah | okay | 13:47 |
ubuntourist | ACTION waits for the change. | 13:48 |
ubuntourist | OK! Now the fun part that actually does the work: | 13:48 |
mulbah | done | 13:48 |
ubuntourist | Maybe you ssh to more than one computer. Or you will in the future. Sometimes to the MCSS server, and as you start doing | 13:49 |
ubuntourist | work for other people, you will ssh into their servers. | 13:50 |
ubuntourist | So, this file has sections. I like to call them "stanzas" which is a musical and poetry term, but it is used for sections in computer files too. | 13:50 |
ubuntourist | We are going to make a "stanza" for the MCSS server. | 13:51 |
ubuntourist | Put in a blank line and then another comment: | 13:51 |
ubuntourist | # 2023.07.14 - MCSS server | 13:51 |
ubuntourist | # | 13:51 |
ubuntourist | We're making a comment that says WHAT this stanza is for, and WHEN we created it. | 13:52 |
mulbah | okay | 13:52 |
ubuntourist | Next line: | 13:52 |
ubuntourist | Host students.mcssliberia.org | 13:53 |
ubuntourist | Now the next two lines are indented two spaces. Right where you are now (no empty line): | 13:54 |
ubuntourist | User mulbah | 13:54 |
ubuntourist | ForwardX11Trusted yes | 13:55 |
ubuntourist | (NO EMPTY LINE. INDENT TWO SPACES.) | 13:55 |
ubuntourist | Not two tabs. two spaces. | 13:55 |
mulbah | is that it | 13:55 |
mulbah | oh okay | 13:56 |
ubuntourist | That's it. And now the second line above that starts with Forward... | 13:56 |
ubuntourist | Trusted is spelled wrong. Fix it. | 13:57 |
ubuntourist | Great! | 13:58 |
ubuntourist | We've got a few more lines to add, but let me explain that part first. | 13:58 |
mulbah | okay | 13:59 |
ubuntourist | If you save it now, you will be able to say "ssh student.mcssliberia.org" and it will look in the file and say "Oh. I see: you want me | 13:59 |
ubuntourist | to log into the User mulbah." | 13:59 |
ubuntourist | You have set the default user for the computer students.mcssliberia.org to "mulbah". | 14:00 |
ubuntourist | The second line is a little harder to explain, and actually not necessary... yet -- especially with your bad network connections. | 14:01 |
mulbah | I have a good network connection now | 14:01 |
mulbah | I am at my house | 14:02 |
ubuntourist | The second line says "If there is an application program on MCSS that uses graphics -- like maybe something that will play a game on the server | 14:02 |
mulbah | I did not go to the lab today because I'm not feeling well | 14:02 |
ubuntourist | it needs to be able to send the graphics to my computer. I am explixitly telling the my computer 'Trust graphics coming from the server. Allow the server to draw on my screen." | 14:03 |
ubuntourist | In technical terms, you are telling the server to "forward all X11 windowing system information" but it means the server has | 14:04 |
ubuntourist | permission to draw and paint on your screen. | 14:04 |
ubuntourist | ... | 14:04 |
ubuntourist | Now onto improvint it. A few more lines, without empty lines: | 14:05 |
ubuntourist | No indentation: | 14:05 |
ubuntourist | Host mcss | 14:05 |
ubuntourist | Actually, the first line is not indented but the next three are indented two spaces. Type: | 14:06 |
ubuntourist | Host mcss | 14:06 |
ubuntourist | Hostname students.mcssliberia.org | 14:07 |
ubuntourist | User mulbah | 14:07 |
ubuntourist | ForwardX11Trusted yes | 14:07 |
ubuntourist | (Type the four lines above.) | 14:07 |
mulbah | okay | 14:08 |
mulbah | ACTION done | 14:10 |
ubuntourist | I would remove the blank line above Host mcss. | 14:10 |
mulbah | ACTION done | 14:11 |
ubuntourist | (It's not necessary, but in the future, as you add more computers it will be easier to see that this stanza is all together. | 14:11 |
ubuntourist | Ctrl-X | 14:11 |
ubuntourist | Y | 14:11 |
mulbah | I did | 14:11 |
ubuntourist | ENTER | 14:11 |
ubuntourist | ls -l .ssh | 14:12 |
ubuntourist | ls -l | 14:12 |
ubuntourist | (most config is better. <grin> | 14:12 |
mulbah | okay | 14:13 |
mulbah | so should I ssh-copy-id into the server | 14:13 |
ubuntourist | One more thing to check: We want to make sure the permissions on the file are correct. | 14:13 |
ubuntourist | ls -l | 14:13 |
ubuntourist | Dash L like above. | 14:14 |
ubuntourist | OK. Do you see at the start of each line the "-rw...." Those are the file permissions. | 14:14 |
mulbah | oaky | 14:15 |
ubuntourist | Because ssh is the "SECURE SHELL" -- security is important. We do not want to give too many permissions to files. | 14:15 |
ubuntourist | You are the only one who uses your computer. But Linux does not know that. It always assumes that there might be other users | 14:16 |
ubuntourist | who can login to your computer, with a different user name. And it lets you share files with them. But... | 14:16 |
ubuntourist | some files you do NOT want to share. | 14:16 |
ubuntourist | the permissons break down into four parts. The first is a single, special letter that shows if a file is "unsual". If it is a "-" it is | 14:17 |
ubuntourist | a normal file. If it is a "d" it is a directory. (See the last file in the ls that you typed.) | 14:18 |
ubuntourist | if it is an "l" then it is a symbolic link, which we talked about last time. There are a few other special letters, but we won't worry about those yet. | 14:18 |
ubuntourist | The next nine characters are three groups of three letters "rwx" or "---" or some combination of the two. | 14:20 |
ubuntourist | Are you understanding so far? | 14:20 |
mulbah | yeah | 14:21 |
ubuntourist | For "config" right now it reads "-rw-rw-r--" which breaks apart as "-", "rw-", "rw-" and "r--". | 14:21 |
ubuntourist | This means it's a "normal file" (not a directory, not a symbolic link) "-". The next three sections explain who can do what with the file. | 14:22 |
ubuntourist | The first three "rw-" means that the OWNER -- that's you -- is granted the permissions to Read the file (r) like with less or most, Write to the file (like with nano or vim) | 14:23 |
ubuntourist | but you cannot eXecute ("x") the file. In other words, it should not be considered as an application program. | 14:24 |
ubuntourist | So "rw-" | 14:24 |
ubuntourist | The second set "rw-" again says that other users that are in the same GROUP as you can do the same: They can read from and write to the file. | 14:25 |
ubuntourist | System administrators can create groups, and assign several users to the same group. | 14:25 |
ubuntourist | In a large co-op, maybe three people will be working on a web site for a school and five other people will be developing a web site for a hospital. | 14:26 |
ubuntourist | You want to put 3 people in 1 group and let them share school-related files, and 5 in another group and let them share hospital-related files. | 14:27 |
ubuntourist | But you don't want people in the hospital group to overwrite and edit the school web site files. So you want separate groups | 14:28 |
ubuntourist | and separate permissions. | 14:28 |
ubuntourist | The third set of permissions is OTHER -- everyone who is NOT you, and NOT in your group. Right now, they can only Read "r--" the config | 14:29 |
ubuntourist | Understand? | 14:29 |
mulbah | yeah | 14:31 |
mulbah | i'm understanding | 14:31 |
ubuntourist | Whenever you create a new file with nano, or vim, or lots of other programs. It sets the default permission to "-rw-rw-r--" But... for config, it did the wrong thing. | 14:32 |
ubuntourist | You do NOT want anyone else to read or modify the file. | 14:32 |
ubuntourist | So we are going to change the permission on that file. | 14:33 |
ubuntourist | The permissions are sometimes called "permission modes". The command to change them is "chmod" for "change modes" | 14:34 |
ubuntourist | You should probably read up on chmod. But for now, we're just going to change the mode quickly so we can continue. Type the next two lines: | 14:35 |
ubuntourist | chmod 600 config | 14:35 |
ubuntourist | ls -l | 14:35 |
ubuntourist | See how the permissions on config have changed? | 14:36 |
mulbah | yeah | 14:37 |
ubuntourist | You have disabled GROUP and OTHER users so that they cannot see or touch that file. | 14:37 |
ubuntourist | NOW try "ssh mcss" | 14:38 |
mulbah | it have change from -rw-rw-r-- 1 | 14:38 |
mulbah | to -rw------- 1 | 14:38 |
mulbah | okay | 14:38 |
ubuntourist | (The "1" is something else. Not important for a very long time.) | 14:39 |
ubuntourist | You can exit again. | 14:39 |
ubuntourist | Because I forget a lot, I have set up TWO configurations on my computer for mcssliberia: I can type: | 14:40 |
ubuntourist | ssh students.mcssliberia.org | 14:41 |
ubuntourist | ssh mcss | 14:41 |
ubuntourist | ssh liberia | 14:41 |
ubuntourist | All three of those, on my computer, mean "kjcole@students.mcssliberia.org" | 14:41 |
ubuntourist | On my computer, that "stanza" looks like: | 14:44 |
ubuntourist | # MCSS Liberia | 14:44 |
ubuntourist | # | 14:44 |
ubuntourist | Host students.mcssliberia.org | 14:44 |
ubuntourist | User kjcole | 14:44 |
ubuntourist | ForwardX11Trusted yes | 14:44 |
ubuntourist | Host liberia | 14:44 |
ubuntourist | Hostname students.mcssliberia.org | 14:44 |
ubuntourist | User kjcole | 14:44 |
ubuntourist | ForwardX11Trusted yes | 14:44 |
ubuntourist | Host mcss | 14:44 |
ubuntourist | Hostname students.mcssliberia.org | 14:44 |
ubuntourist | User kjcole | 14:45 |
ubuntourist | ForwardX11Trusted yes | 14:45 |
mulbah07_ | so you can create more than two configurations files | 14:45 |
ubuntourist | RIGHT. | 14:46 |
mulbah07_ | okay | 14:46 |
ubuntourist | Now. If you have a DIFFERENT computer to ssh to -- NOT students.mcssliberia.org -- | 14:46 |
ubuntourist | add an empty line, and a new comment and follow the same pattern. For example, I log into Jeff's students comptuer with: | 14:47 |
ubuntourist | # Governor's Career and Technical Academy | 14:48 |
ubuntourist | # | 14:48 |
ubuntourist | Host students.gctaa.net | 14:48 |
ubuntourist | User kjcole | 14:48 |
ubuntourist | Host gctaa | 14:48 |
ubuntourist | Hostname students.gctaa.net | 14:48 |
ubuntourist | User kjcole | 14:48 |
ubuntourist | Keep a blank, empty line betweeen stanzas. | 14:48 |
ubuntourist | And, when you edit the file, change the date on the comment line that says | 14:48 |
ubuntourist | # Last modified by ... | 14:48 |
*** mulbah has quit (Ping timeout: 480 seconds) | 14:49 | |
ubuntourist | Did you get all of that? I see your connection is dropping sometimes now. | 14:49 |
mulbah | yeah I get all | 14:50 |
ubuntourist | OK... Well, share it with tboimah and scooper | 14:51 |
mulbah | alright | 14:51 |
mulbah | but I don | 14:51 |
ubuntourist | We've only got nine minutes left, but we talked about a lot. Maybe, since you are not feeling well, we can just stop early. | 14:52 |
mulbah | but I don't think that I have an account on the students.gctaa.net server | 14:52 |
ubuntourist | And your solution with the environment variable "ssh $MCSS" was an excellent idea. Bravo! | 14:52 |
mulbah | Thanks | 14:53 |
ubuntourist | mulbah, I only showed that as an example. I wanted to show that I can have many different computers in the .ssh/config file. | 14:53 |
mulbah | okay | 14:53 |
ubuntourist | Each one starts with a comment telling me what computer the stanza is for. | 14:53 |
ubuntourist | Then a short part with the full name of the computer. Then sections with my abbreviated name for the computer. | 14:54 |
ubuntourist | Maybe one abbreviated name, like for jeff's school "gctaa" or maybe multiple names for yours "mcss" and "liberia". | 14:55 |
ubuntourist | Knowing that you can add more computers to the file as you start doing work on lots of computers is very helpful. | 14:56 |
ubuntourist | It gets painful to remember all the usernames and host computer names. | 14:56 |
ubuntourist | I have 179 stanzas -- 179 computers that I can use SSH with. (Some of those are very old, and probably don't exist now. I really should go through the config file and clean it up...) | 14:58 |
ubuntourist | And, it's 10:59. Time to quit. | 14:59 |
mulbah | okay see you monday | 15:00 |
ubuntourist | See you then! Feel better. | 15:00 |
mulbah | thanks for the day | 15:00 |
ubuntourist | Bye! | 15:00 |
mulbah | Okay I will | 15:00 |
*** ubuntourist has quit (Quit: Leaving) | 15:00 | |
*** mulbah has quit (Quit: Leaving) | 15:39 | |
*** user23 has left #novawebdev (None) | 19:55 |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!