On you local Mac/Linux laptop/workstation do:
$ mkdir .ssh
$ ssh-keygen -t rsa -b 4096 -f .ssh/mykeys
It will generate 2 files: mykeys and mykeys.pub inside the .ssh folder.
Use ' ssh-copy-id' command' to copy the keys to our Virtual server.
Notes: Mac OSX does not have' ssh-copy-id' command.
Download here: https://raw.githubusercontent.com/beautifulcode/ssh-copy-id-for-OSX/master/ssh-copy-id.sh
$ sudo curl https://raw.githubusercontent.com/beautifulcode/ssh-copy-id-for-OSX/master/ssh-copy-id.sh -o /usr/local/bin/ssh-copy-id
$ sudo chmod +x /usr/local/bin/ssh-copy-id
Now you can copy the newly generated key to Virtual server. (Replace 'stty2u' with your users login name)
$ /usr/local/bin/ssh-copy-id -i .ssh/mykeys stty2u@rcloud.stat.ubc.ca
Add your key to your laptop/workstation.
$ssh-add .ssh/mykeys
Test it
$ssh stty2u@rcloud.stat.ubc.ca
You should not be asked for password.