LAB: SSH to mantis without a password
Because you're a current CS student at Carleton, Mike Tie has ensured that you have an account on mantis. As a result, if you're on the Carleton network and you have a Unix terminal open, you can get a command prompt on mantis.mathcs.carleton.edu like so:
(Note that if you're not on the Carleton network either in person or via the Carleton VPN, Carleton's network architecture will prevent you from reaching mantis at all.)
One of the many lovely applications of public-key cryptography is to enable you to set up a public/private key pair that will let you SSH to mantis from your own computer without typing your password.
The setup steps go roughly like this:
- Generate a random public/private key pair.
- Store them in ~/.ssh/ (i.e., in the .ssh folder inside your home folder)
- Copy the public key to the file ~/.ssh/authorized_keys on mantis
It gets a little more complicated if you want to have multiple key pairs for different servers (roughly, you have to edit the ~/.ssh/config file on your local machine), but it's pretty simple.
There are tons of tutorials online for how to do this, depending on your own operating system and the operating system of the computer you want to SSH into. For example, this DigitalOcean tutorial works well if your laptop's OS is Linux or macOS and the server runs Linux (like mantis) or macOS.
If your computer runs Windows, on the other hand, I haven't yet found a tutorial quite as good as the DigitalOcean one, but this one is pretty good.
Want to search for your own tutorial? Try "ssh-keygen Windows tutorial" or "ssh login without password instructions" or something like that.
What to do
- Pick a tutorial and run through it.
- During the tutorial, when it says you may optionally give your new private key a "passphrase", decline to do so (i.e., give it an empty passphrase).
- Try
ssh YOUR_USER_NAME@mantis.mathcs.carleton.edu. If that logs you onto mantis without typing a password, you win. If not, you may need to troubleshoot and/or ask for help.