Secure Shell (SSH)#
You're going to be using SSH a lot. For Linux, and other Unix like operating systems, it's how you're going to securely connect and execute commands. This allows you to manage remote systems like installing software, starting services, etc. You'll even use SSH when you're using Ansible, Puppet Bolt, and other configuration management tools.
Back in the day, we used Telnet to connect to servers and send commands. Here's what I have to say about Telnet: forget about it and never, ever use it.
Telnet sends everything as plain-text. Someone between your client and the remote system can see the commands you're sending or, even worse, the credentials you're using to access the remote system. Telnet doesn't even ship with most operating systems today - if any at all.
SSH replaces Telnet entirely. It's very secure, encrypting all the traffic between your client and the remote server.
All you need to know at this point in time is how-to use an SSH client locally, generate SSH keys, and then use those to connect to a remote SSH server. We won't cover that here as that's not relevant to the protocol itself. We'll also cover all that later on when we eventually need to use SSH.
With SSH you're able to connect to remote systems and send commands to them. This looks a bit like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
We can some key information about the system I've just connected to:
- I logged in using the
ubuntu@<IP>means "user at remote-system"
- This system is using
Ubuntu 20.04.3 LTSas the operating system
- We've got some stats on the system: the disk is
34.0%full; there are
112processes running; etc.
- We have
46updates waiting for us
- A system reboot is required (probably because one of those updates is a kernel update)
What I done here is used the
ssh command to access a remote system as the
ubuntu user. The SSH client has connected to the SSH server and then validated by identity using an SSH keypair.