User Tools

Site Tools


pandoc:introduction-to-vsc:02_connecting_to_vsc:connecting_to_vsc

Login and data transfer

  • Article written by Irene Reichl (VSC Team)
    (last update 2020-10-10 by ir).

Project and User Account

Prerequisites

In order to be able to login VSC you need * a user account ➠ project leader (re-)sets * username * password * phone number for receiving OTP * to be inside university network * either physically * or via VPN-connection to your university * to use a terminal program, e.g. xterm (LINUX), terminal (OSX), putty (originally designed for the Windows platform, however, can also be used on other platforms: https://www.putty.org), …


Project and User Account

Let us have a look at the first part, in the figure above denoted by a green box: connecting from the local machine to the remote VSC login nodes.


Connecting to VSC

Terminals:

linux: xterm, mac: terminal ## alternative terminal connection  PuTTY

As stated before, putty was originally designed for the Windows platform, however, can also be used on other platforms, you can download it from: https://www.putty.org)


Connecting to VSC

VSC-3 has 5 login servers named l31, …, l35.

VSC-4 has 10 named l40, …, l49.

Login via

# VSC-3
[...]$ ssh <me>@vsc-3.vsc.ac.at
# VSC-4
[...]$ ssh <me>@vsc-4.vsc.ac.at

assigns you to a VSC-3 oder VSC-4 login node per round robin manner.

Note: In the following we use “me” as representative username, please replace that by your own username and omit the “smaller/greater than” signs, i.e., write myusername@vsc……!


Connecting to VSC

You may have reason to login to a specific login server:

# VSC-3
[...]$ ssh <me>@l31.vsc.ac.at
                ..
[...]$ ssh <me>@l35.vsc.ac.at
# VSC-4
[...]$ ssh <me>@l40.vsc.ac.at
                ..
[...]$ ssh <me>@l49.vsc.ac.at

This may be necessary for trouble shooting.



.bashrc

With the .bashrc file in your home directory you are able to set your preferences for your bash shell. On VSC we provide a recommended .bashrc file that you may use if you like.

For some libraries on VSC it is important that you have set the language settings properly. A locale is a set of environmental variables that defines the character encoding, language, time/date format, numbers, … for your system libraries and locale-aware applications on a Linux system.

Maybe in your local

/etc/ssh/ssh_config

you find a command

SendEnv LANG LC_*

which means that in ssh connections the local environment is taken to the remote machine. E.g., my local settings are, where some variables are not set as you see.

LANG=""
LC_CTYPE="UTF-8"
LC_ALL=

That is one point. But even if you do not take your local language settings with you,

has no value on VSC,  by default.

Way out: 
For certain libraries it is necessary to set these two lines in your .bashrc:
# .bashrc
``` {.bash}
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8


again and again

The OTP-key holds for 12h and for the IP you login. However, each time you want to have a new shell on the cluster you will be asked to type the password. Is there a way out?


ssh-keys

Using ssh-keys is a possible which enables to open several shells on the cluster by using a passphrase only once.

Therefore you generate a key on your local machine which you copy to the remote machine. In order to login you use port 27 instead of the default ssh port 22. The key -optimally and we reaallay ask you to generate it that way- is protected by a passphrase. This passphrase should be as secure as possible.


ssh-keys

ssh-keys — tunneling

You may want to jump (tunnel) over a host which is between your local machine and VSC. Then you need to copy your key to both machines, the jump host and VSC.


ssh-keys — tunneling

how to set up ssh-keys on client and login node

[...]$ eval `ssh-agent`     # start ssh agent
[...]$ echo $SSH_AGENT_SOCK # check if it is running
[...]$ chmod 700 ~./ssh     # change rights of .ssh-directioy
[...]$ ssh-keygen -t rsa    # generate key on local machine

will be asked to create a pass phrase. that passphrase must be as secure as your password. IT IS POSSIBLE AT THAT POINT TO GIVE NO PASSWORD, BUT NEVER EVER GENERATE A KEY WHICH IS NOT PROTECTED !!! This may be a hazard for our system.

[...]$ ssh-copy-id <me>@vsc4.vsc.ac.at # copy key to remote machine

will be asked for password & OTP on VSC-4

more about the SSH agent


Backup Policy

for details see Storage


Sync and Copy

If you copy with scp you always copy everything. On one hand, it may take ages until everything is copied, on the other hand, you may waste storage if there had only been minor modifications in your data. For that reason you may use rsync which first compares source and destination directory/file structure, subsequently only copying what did actually change. This saves time and disc space.


Sync and Copy

scp <source> <destination>
scp <me>@vsc3.vsc.ac.at:~/<myfile.c> .
scp myfile.c <me>@vsc4.vsc.ac.at:~/
rsync [OPTIONs] <source> <destination>
maybe useful: -av, --exclude=/daten/temp/...

in order to setup on the remote machine, follow: WIKI-link:rsync on remote machines


Copy — alternative via FileZilla

FileZilla

For using FileZilla, make sure that you choose “interactive login”. This is necessary to be able to login via two factor authentication. If you are already logged into the cluster via, e.g., PuTTY or another terminal program, you can also login via a normal session because the OTP is only asked once in 12h per cluster (VSC-3 or VSC-4) and IP address.


Copy — alternative via winscp

winscp


pandoc/introduction-to-vsc/02_connecting_to_vsc/connecting_to_vsc.txt · Last modified: 2020/10/20 09:13 by pandoc