Create a gist now

Instantly share code, notes, and snippets.

@vaidap /ssh.md Secret
Last active Mar 30, 2018

Embed
What would you like to do?
A guide to remotely accessing DICE machines for Informatics students

A guide to remotely accessing DICE machines

Remote access allows you to connect to a DICE machine and access your personal files from your personal computer. The following sections & comments on this file detail the different ways you can achieve this.

SSH

Basic usage

Official resource

ssh s1234567@student.ssh.inf.ed.ac.uk
ssh student.login

Now you are "inside DICE" so to speak. If you run ls, you can see that you can access all the files on your DICE account! You can also run programs and do most things you would do in a DICE terminal. For example, you can launch command-line text editors with nano file.py or vim file.py. For computation-heavy jobs, please use student.compute instead of student.login. Use logout twice to terminate the SSH session (it will time-out after some time either way).

Advanced usage

X-11 forwarding

Append -X to both SSH commands:

ssh s1234567@student.ssh.inf.ed.ac.uk -X
ssh student.login -X

Now, find a file you'd like to open and run gedit <file>. A graphical window will appear and you will be able to edit the file using the text editor of your choice. Note that this might not be a great option if your internet is slow, and keep in mind that only editors and software that you have already installed on DICE (not your local computer) can be launched!

SSHFS

sudo apt-get install sshfs
mkdir DICE
sshfs s1234567@student.ssh.inf.ed.ac.uk: DICE/

You will now have all your DICE files available on your local machine, in the DICE folder. If you'd like to mount a specific folder, use s1234567@student.ssh.inf.ed.ac.uk:my-folder/.

Virtual DICE

Graphical interface! DICE as you know it, from the comfort of your home! Computing help page on Virtual DICE

Misc

You might also want to have a look at iFile, NX and AFS as they might better fit your needs.

@livecodealex

This comment has been minimized.

Show comment
Hide comment
@livecodealex

livecodealex Mar 18, 2018

Afaik sshfs doesn't work on macs, but to be fair, what does work on macs these days?

Afaik sshfs doesn't work on macs, but to be fair, what does work on macs these days?

@neanias

This comment has been minimized.

Show comment
Hide comment
@neanias

neanias Mar 18, 2018

I’d say remove the note about being Ubuntu-specific. These instructions should work for all POSIX/*nix systems, both Linux and macOS. Not sure how to do this on Windows, probably using PuTTY?

neanias commented Mar 18, 2018

I’d say remove the note about being Ubuntu-specific. These instructions should work for all POSIX/*nix systems, both Linux and macOS. Not sure how to do this on Windows, probably using PuTTY?

@vytukas

This comment has been minimized.

Show comment
Hide comment
@vytukas

vytukas Mar 18, 2018

Windows users...
I find WinSCP and PuTTY together very useful.
When launching WinSCP, it will ask the details to connect to an SSH server, just enter the same details used in the guide above, no need to change any other settings. On the main window there will be an icon on the top with the icon of PuTTY: during the first run, it will ask you to find the location of PuTTY executable.
PuTTY alone will work perfectly as well.

NB: When copying any text / code files from Windows, change line ending encoding from Windows CRLF to Linux LF, otherwise things like Python compiler will very likely complain :-)

vytukas commented Mar 18, 2018

Windows users...
I find WinSCP and PuTTY together very useful.
When launching WinSCP, it will ask the details to connect to an SSH server, just enter the same details used in the guide above, no need to change any other settings. On the main window there will be an icon on the top with the icon of PuTTY: during the first run, it will ask you to find the location of PuTTY executable.
PuTTY alone will work perfectly as well.

NB: When copying any text / code files from Windows, change line ending encoding from Windows CRLF to Linux LF, otherwise things like Python compiler will very likely complain :-)

@dkambersky

This comment has been minimized.

Show comment
Hide comment
@dkambersky

dkambersky Mar 19, 2018

Possibly Linux specific: if using X forwarding and the remote machine complains and can't open an X window, adding an Y flag (-XY instead of -X) can help - it relaxes some security controls and allows more stuff through (I know I had to use it when using the comn VM remotely).

Possibly Linux specific: if using X forwarding and the remote machine complains and can't open an X window, adding an Y flag (-XY instead of -X) can help - it relaxes some security controls and allows more stuff through (I know I had to use it when using the comn VM remotely).

@martinosorb

This comment has been minimized.

Show comment
Hide comment
@martinosorb

martinosorb Mar 19, 2018

@livecodealex : it is possible to install sshfs on Mac OS, look up OSXFuse.

@livecodealex : it is possible to install sshfs on Mac OS, look up OSXFuse.

@martinosorb

This comment has been minimized.

Show comment
Hide comment
@martinosorb

martinosorb Mar 19, 2018

Advanced ideas:

  1. you can use a .ssh/config file. This allows you to do everything in an automated way, you won't have to go through the ssh gateway manually. If you copy the following into a ~/.ssh/config file
Host *
        ServerAliveInterval 20

Host *.inf.ed.ac.uk !ssh.inf.ed.ac.uk
        PubkeyAuthentication no
        RSAAuthentication no
        GSSAPIAuthentication yes
        GSSAPIDelegateCredentials yes
        ProxyCommand ssh -K sXXXXXXX@ssh.inf.ed.ac.uk nc %h %p
        User sXXXXXX

Where sXXXXXX is your informatics username.

  1. Use kerberos. This will make sure you won't need to type your password more than once per day while doing remote work. The instructions on how to set it up are con the computing support page.

Advanced ideas:

  1. you can use a .ssh/config file. This allows you to do everything in an automated way, you won't have to go through the ssh gateway manually. If you copy the following into a ~/.ssh/config file
Host *
        ServerAliveInterval 20

Host *.inf.ed.ac.uk !ssh.inf.ed.ac.uk
        PubkeyAuthentication no
        RSAAuthentication no
        GSSAPIAuthentication yes
        GSSAPIDelegateCredentials yes
        ProxyCommand ssh -K sXXXXXXX@ssh.inf.ed.ac.uk nc %h %p
        User sXXXXXX

Where sXXXXXX is your informatics username.

  1. Use kerberos. This will make sure you won't need to type your password more than once per day while doing remote work. The instructions on how to set it up are con the computing support page.
@martinosorb

This comment has been minimized.

Show comment
Hide comment
@martinosorb

martinosorb Mar 19, 2018

Third thing: you don't need to access a specific remote machine to access your Dice directory. You can directly mount the AFS, instructions again on the computing support page.

Third thing: you don't need to access a specific remote machine to access your Dice directory. You can directly mount the AFS, instructions again on the computing support page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment