-
Notifications
You must be signed in to change notification settings - Fork 2
Tips for getting set up using the server over ssh
You will each receive individual login instructions in a separate (email/slack) message from Akshay.
Follow those instructions to connect to the server over ssh
using the terminal app on your laptop. In the course of logging in you will need to choose a new secure password.
Once you have established this connection, here are some things you can set up to make working with a remote server easier.
This step will enable you to connect securely without having to type your password each time.
- Generate a new ssh key-pair and put it in the
~/.ssh
directory of your laptop:
It is more secure / recommended that you supply a secure passphrase when creating this key.
ssh-keygen -f ~/.ssh/id_dssg_server -t ed25519
With a passphrase, you will need to "unlock" the key just once after each reboot of your laptop. Run the command below to unlock the key now:
ssh-add ~/.ssh/id_dssg_server
- Add the host to the ssh
config
file on your laptop:
Create/open the file ~/.ssh/config
in a text editor and add the following lines (customizing the with your server/user details):
Host dssg
Hostname <SERVERNAME>.ess.washington.edu
User <USERID>
Port <PORTNUMBER>
IdentityFile ~/.ssh/id_dssg_server
- Add your public key to the authorized list on the server:
ssh-copy-id -i ~/.ssh/id_dssg_server dssg
You will need to provide the password you created for your account on the server now.
Once that is complete, you can simply log into the server from your laptop:
ssh dssg
No password required!
With the above access set up, copying individual files to/from your laptop is simple.
One thing you will probably want to do is copy your Github ssh keys to the server so you can push changes to our Github repo directly from the server.
You can easily do this securely using the scp
command. If you need to move very large files or keep whole directories of files in sync, then the rsync
tool is a better choice than scp
, but it's significantly more complex, so for simple things like copying some key files, scp
works great:
scp ~/.ssh/<GITHUBKEYFILE>* dssg:~/.ssh
Once you've copied over your Github key files, if you want to make accessing Github even easier, add entries to the ~/.ssh/config
files on both your laptop and the server like:
Host github github.com
Hostname github.com
User git
IdentityFile ~/.ssh/<GITHUBKEYFILE>
With all of the above, you should be able to clone our repo on the server over ssh with:
git clone [email protected]:uwescience/DSSG2023-Groundwater.git