SSH

From Remeis-Wiki
Revision as of 15:00, 11 April 2018 by Sokolova-lapa (talk | contribs) (Created page with " Category:Working Remotely = Working remotely using SSH = If you want to connect to a machine at Remeis from remote you can use, e.g., SSH. This is a secured connection...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Working remotely using SSH

If you want to connect to a machine at Remeis from remote you can use, e.g., SSH. This is a secured connection, which forwards a shell on the machine to your local computer.

Linux

On a linux system, you need to have SSH installed. On Debian based system, such as Ubuntu, that can be achieved by

sudo apt-get install ssh

Once SSH is installed, just type

ssh username@constellation.sternwarte.uni-erlangen.de

into your local shell. Replace username by your login at Remeis and constellation by the name of the machine at Remeis, e.g., leo. You will be then asked by your password. You may use SSH-Keys to avoid entering you password.

It is also possible to enabled X11 forwarding with the -X option, which allows you to open window-based applications, such as konqueror or pgplot:

ssh -X username@constellation.sternwarte.uni-erlangen.de

In that case the window opens at your local machine. Be aware that X11 forwarding requires a lot of bandwidth, which will slow down the windows and any actions you do significantly. To slightly increase the speed you can choose to compress the commands between bots machines via

ssh -X -C username@constellation.sternwarte.uni-erlangen.de

SSH-Keys

To avoid typing in your password at the remove machine every time you log in, you might consider installing SSH-Keys.

Screen

Sometimes, a ssh session will terminate due to the error "Write failed: broken pipe" or something similar. As this can have various reasons, the best is to use screen in any case. This allows you to attach and detach a running remote terminal session at any time. This way, you can run a job on screen, detach the session, switch off the laptop, and resume this remote session later.

To start the screen session type

screen

To detach it:

Cntr-a-d

To resume it later:

screen -r -d

The only disadvantage (unable to scroll back) is no, if you add this to your ~/.screenrc:

termcapinfo xterm ti@:te@                                                                                   
termcapinfo xterm-color ti@:te@  

Windows

If your local computer is running Windows as operating system you need to download and install a SSH-client, such as [[1]]. A guide how to use Putty is available here: [[2]]