SSH Keys
SSH keys are like passwords, but better.
Work in progress
This page was automatically migrated from the legacy Taggi site ( https://taggi.cse.unsw.edu.au/FAQ/SSH_Keys/) and is pending review. Content, links and screenshots may be incomplete or incorrect.
What are SSH Keys?
- A public key file that gets installed into the account you want to log into. This is not sensitive, and can be freely shared with others.
- A private key file that stays secure in your account or on your computer. This is sensitive, and must not be shared with anyone.
- A passphrase, which is a password for the private key. This is also sensitive, and like any password, must not be shared.
SSH keys at CSE
Generating a key
- Connect to a login server or VLAB using your zID and zPass
- From the terminal, run
ssh-keygen -t rsa - Accept the default path and filename when prompted, and be sure to set a secure passphrase
- This will create
~/.ssh/id\_rsa.pub(your public key) and~/.ssh/id\_rsa(your private key). - Keep the private key for yourself. Only give the public key to other people.
The default key type that ssh-keygen creates is RSA. It is considered safer now to use elliptic curve key types. eg: ssh-keygen -t ed25519
Adding an SSH key to an account you control.
- Get a copy of the public key.
- Login to the CSE account that want to accept logins using that key.
- Append the public key to the file
.ssh/authorized\_keys
You can do that with an editor or with a shell command like:cat _key.pub_ >> ~/.ssh/authorized_keys - Ensure the
authorized\_keysfile is only readable by its account:chmod 600 ~/.ssh/authorized_keys
Adding an SSH key to another account
Using your SSH key from your own computer
Downloading your key
-
Set up Cyberduck on your computer, and connect to your own homedir
-
Ensure that Edit -> Preferences | Browser | Show Hidden Files is selected.
-
Download your private key from
.ssh/id\_rsato your own computer -
If you haven't already, download and install PuTTY on your computer.
-
Run the
PuTTYgenapp that comes bundled with PuTTY -
Go to Conversions -> Import to open the
id\_rsakey you downloaded -
Click Save Private Key to save out a
.ppkversion of the file

