ssh

Secure shell (ssh)

  • A secure tool for connecting and interacting with remote systems
  • Uses session based or public key encryption
  • Run a single command or work interactively
  • Lots of other neat tricks (proxying, port forwarding, many more)

Connecting to gort

  • Everyone (registered) should have a visitor account of the stats servers now
  • Try to connect to make sure everything is working…
  • Replace cr173 with your netid
  • The password is your regular password
$ ssh cr173@gort.stat.duke.edu
The authenticity of host 'gort.stat.duke.edu (152.3.7.55)' can't be established
.
RSA key fingerprint is 74:30:5a:d0:cd:a8:d2:6f:a6:e9:c6:80:bb:eb:b4:ba.
Are you sure you want to continue connecting (yes/no)?yes
cr173@gort.stat.duke.edu's password:
[cr173@gort ~]$

Working remotely

You should now be able to run commands remotely on gort. We can interactively run commands on the remote system. Try hostname to see which system you are connected to, and whoami to see your user name.

cr173@gort [~]$ hostname
gort.stat.duke.edu
cr173@gort [~]$ whoami
cr173

Finishing up

Once you are done on the server you can exit by:

  • Typing exit on the command line
  • Ctrl-D
  • Wait long enough (connection will time out)

RStudio

You also should test that you are able to connect to the department's RStudio Server:


Go to:
http://gort.stat.duke.edu:8787


Login using your netid and password.

For the Ambitious

ssh alternative - mosh

mosh is an extension / wrapper to ssh that is designed to work in an environment where connections are not stable (ie. on a phone or laptop)

  • mosh connections persist even if you
    • close your laptop
    • lose your wifi connection
    • connect to a different network


Passwordless logins

If you don't like having to type your password every time you login, you can setup public key authentication.

  • To do this you generate two keys - a public key and a private key.
  • The public key is shared with the server, which then lets ssh use your private key as a way of verifying your identity.


The Setup is a bit complicated, but it is something you only need to do once, a decent tutorial can be found here:

https://kb.iu.edu/d/aews

Follow steps 1 - 9, just replace the user names with your netid and server names with gort.stat.duke.edu.