Login and administer remote servers using ssh.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
README.md
Vagrantfile

README.md

Class: SSH

Servers and Tools


In this class I'll show you how to use SSH and the OpenSSH program to login to a remote shell session, run remote commands, upload and download files. You'll also see how to combine IO redirection and pipes with the ssh command to make some powerful combinations. These are the tricks I wished I had known about years ago.

What's in this class?

  • What is SSH? - SSH is a protocol that allows two machines to communicate securely. It can be used to launch a remote shell, upload and download files, and to run remote commands.

  • Setup with Vagrant - Often times you'll be using SSH with a machine running in the cloud, on Amazon or Google for example. But we're going to use a virtual machine that runs on your local computer because it's free and you can play around offline.

  • Logging in with SSH - We'll start off by creating a new user and giving that user a password. Then we'll get the ssh configuration information from Vagrant and login to the machine as our new user.

  • Running Remote Commands - Instead of launching a remote shell, sometimes we just want to run a script on the remote machine and then exit. This comes in handy during deployment, for example. You can also use standard input and output with ssh to send and receive information, enabling some powerful tricks.

  • SSH Keys - Most of the time you don't want to login to a remote machine using a password. It's a lot easier, and more secure, to use a secure key instead. In this video I'll show you how to create a new public/private rsa key pair. Then we'll configure the server to allow the user to authenticate using the keys.

  • Using a Config File - We can use a configuration file, usually stored in ~/.ssh/config, instead of having to type all of the options and the full host name each time. A config file makes it much easier to work with SSH! We can even give our remote machine a shortcut host name to make typing it even easier.

  • The Server Software - The reason we're able to login to a remote machine using the SSH protocol is because there is a piece of software running on the remote machine. The software is called a "daemon" because it's continuously running in the background. The name of the OpenSSH daemon is sshd.

  • Copying Files - The scp command is awesome. It makes it super easy to upload and download files to and from a remote machine.