- Avoiding a passwordHow to avoid the need to enter your password every time you log in or rsync files.
You will generate a pair of keys and place the public key on the remote machine, keeping the private key safe on your personal computer. Then, when you attempt to log in, the private and public keys are automatically compared and you are logged in without a password.
You only need to set this up once.
Apple OS X / Linux
Generate a pair of keys on your personal computer
$ ssh-keygen -t rsa
accept the default location to save the keys by pressing Enter at the prompt
Enter file in which to save the key (/Users/s1234567/.ssh/id_rsa): [press Enter]
For this assignment, an empty passphrase is fine (you could then delete the public key from the lab computers when you’ve finished the assignment). Optionally, you can provide a passphrase of your choice, and make a note of it somewhere. You would have to enter this each time you use the keys, which is less convenient but more secure than an empty passphrase.
Now we need to copy the public key to the lab computers. Connect to the VPN, then do
$ ssh-copy-id s1234567@ppls-atl-0020.ppls.ed.ac.uk
Note for Mac users: if you don’t want to install Homebrew just to get
ssh-copy-id
then you can manually install your public key on the lab computers by following that section of the Windows instructions below.Once you have ssh keys set up, you should find that both
ssh
andrsync
now work for any lab computer (e.g.,ppls-atl-0020.ppls.ed.ac.uk
) without a password. The same pair of keys, created using the instructions above will work for all lab machines. You do not need to repeat this if you change to a different machine (e.g.,ppls-atl-0021.ppls.ed.ac.uk
).Currently, ssh keys do not work for rsync to
scp1.ppls.ed.ac.uk
so you will have to rsync to a lab machine, such asppls-atl-0020.ppls.ed.ac.uk
. Note thatscp1.ppls.ed.ac.uk
is always available (which is why we use that server when mounting the filesystem) whilst individual lab machines are only available if booted into Linux.Microsoft Windows
This tutorial looks to be correct, or follow the instructions below.
Read the instructions above to understand the concept of public/private keys. Then use the PuTTYgen utility (which was installed when you installed Putty) to generate keys.
You now need to install your public key on the lab computers. Here’s one way to do that by logging in to any lab computer and doing this on the lab computer:
$ cd $ mkdir .ssh $ cd .ssh $ touch authorized_keys $ nano authorized_keys $ chmod 600 authorized_keys
now find your public key in PuTTYgen and copy it to the clipboard, paste it into nano (after any existing content), then exit the nano editor with control-x, answering “Y” to the prompt about saving the file.
- (Re)connectingHow to create - and re-connect to - a persistent session that continues running on a lab computer even if the VPN drops, or your personal computer goes to sleep or is rebooted.
under construction
screen
under construction…