In computing, Secure Shell or SSH is both a computer program and an associated network protocol designed for logging into and executing commands on a networked computer. The designers of SSH aimed to replace the earlier rlogin, TELNET and rsh protocols, and the resultant protocol provides secure encrypted communications between two untrusted hosts over an insecure network. Users of SSH can also use it for tunneling, forwarding arbitrary TCP ports and X11 connections over the resultant secure channel; and can transfer files using the associated SFTP or SCP protocols. An ssh server, by default, listens on the standard TCP port 22.
SSH login
To use SSH login to the G-bar, use the command
ssh s081234@login.gbar.dtu.dk
This will give you access to the front-end machine, from where you need to connect to one of the application nodes by means of the command
linuxsh
If you want to make use of X-forwarding, add -X to both the ssh and the linuxsh commands.
Please note that you are not supposed to run any application on the front-end machines. In fact, most applications are available on the Linux nodes, only!
SCP utility
Often, you will need to copy your files back and forth between your computer, and the G-Bar. If you are working with a Unix-based system (Mac, Linux etc.), then this can be done using the scp-utility. To copy a file from your computer to the G-Bar:
scp file username@transfer.gbar.dtu.dk:~/
And doing it the other is just a matter of reversing the arguments. The path can be specified after : (under UNIX, ~ refers to your home directory). Note that you cannot move files from the G-Bar system when you are logged on the G-Bar to your own computer.
If you are using Windows, you may want to check out WinSCP, which provides a nice graphical user interface for accessing your G-Bar home directory.
SSH Keys
Linux
$ ssh-keygen -t rsa Enter file in which to save the key (/home/user/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again:
Copy the public key to the server:
$ ssh-copy-id -i ~/.ssh/id_rsa.pub transfer.gbar.dtu.dk
MacOS
Create the key as Linux above. Copy the public key to the server:
$ cat ~/.ssh/id_rsa.pub | ssh transfer.gbar.dtu.dk "cat >> ~/.ssh/authorized_keys"
To add to your MacOS Keychain:
$ /usr/bin/ssh-add -K
Now for both Linux and MacOS you can ssh to the Gbar systems using your ssh-public-key.
Windows
As MacOS and Linux are similar in ssh key setup, the steps are fairly simple. Windows however has no native ssh/scp support, therefore you need to use some additional software: PuTTY
SSH tunneling
Deprecation Notice: Please note that the use of VNC on the G-bar servers is no longer possible. The examples below are kept, however, as tunneling can be used for other things as well, and VNC is a convenient example.
SSH-tunnelling is an efficient tool for protection of personal data. If you e.g. connect with a VNC client to the server G-Bar login server, the data sent between your computer and login.gbar.dtu.dk will not be encrypted. This means that others may be able to get hold of your password. If you transmit your data through a ssh-tunnel, your data will be save.