User Tools

Site Tools


exercises:2016_uzh_cmest:login

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
exercises:2016_uzh_cmest:first_simulation_run [2016/09/21 11:21] – [Module loading] tmuellerexercises:2016_uzh_cmest:login [2020/08/21 10:15] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== Your first simulation ======+====== First Login ======
  
-In this exercise you will learn how to run your first calculation.+In this exercise you will learn how to login and run commands on our infrastructure.
  
 ===== Part I: Login ===== ===== Part I: Login =====
Line 149: Line 149:
  
  
 +===== Part III: Advanced account configuration =====
 +
 +==== Make module loading persistent ====
 +
 +Upon login, the shell (''bash'' in our case) executes a number of files if they exist. One of them is the ''.bashrc''. To prepare it for management using the the ''module'' command, simply execute the following **once**:
 +
 +<code>
 +$ echo 'module load ' >> ~/.bashrc
 +</code>
 +
 +after that you can add and remove modules to be loaded at startup using ''module initadd'' or ''module initrm''.
 +
 +To add ''vmd'' and ''cp2k'', run for example:
 +
 +<code>
 +$ module initadd vmd
 +$ module initadd cp2k/r17408_2016_09_19
 +</code>
 +
 +to remove ''vmd'' again from the list of modules to load:
 +
 +<code>
 +$ module initrm vmd
 +</code>
 +
 +Alternatively you can of course simply edit ''.bashrc'' using your favorite editor and add a line like ''module load vmd cp2k/r17408_2016_09_19'' by yourself.
 +
 +==== Setup key-based authentication ====
 +
 +To avoid having to type the password every time you log in (and to increase the security), keys can be used for authentication instead. The following instructions are **for OSX and Linux**.
 +
 +First generate a key-pair **on your local machine** using
 +
 +<code>
 +$ ssh-keygen
 +</code>
 +
 +and accept the defaults proposed and do not set a password.
 +
 +Upload the public key **from your local machine** to tcopt3:
 +
 +<code>
 +$ scp ~/.ssh/id_rsa.pub studentXX@tcopt3.chem.uzh.ch:~/
 +</code>
 +
 +Now login to ''tcopt3.chem.uzh.ch'' and move the uploaded public key to the right place:
 +
 +<code>
 +$ mkdir -p .ssh
 +$ chmod 0700 .ssh
 +$ mv id_rsa.pub .ssh/authorized_keys
 +</code>
 +
 +When connecting to the server **from your local machine** now, use:
 +
 +<code>
 +$ ssh -i ~/.ssh/id_rsa studentXX@tcopt3.chem.uzh.ch
 +</code>
 +
 +==== Simplify the login ====
 +
 +The following instructions apply **apply to OSX and Linux**.
 +
 +**On your local machine** add the following part to the file ''.ssh/config'' in your home directory:
 +
 +<code>
 +Host tcopt3
 +  HostName tcopt3.chem.uzh.ch
 +  User studentXX
 +</code>
 +
 +after which you will be able to connect to ''tcopt3'' simply by using
 +
 +<code>
 +$ ssh tcopt3
 +</code>
 +
 +If you have setup key-based authentication as shown above, augment the entry to the following instead, to always use key-based authentication without having to specify ''-i ~/.ssh/id_rsa'' manually:
 +
 +<code>
 +Host tcopt3
 +  HostName tcopt3.chem.uzh.ch
 +  User studentXX
 +  IdentityFile ~/.ssh/id_rsa
 +  IdentitiesOnly yes
 +  PreferredAuthentications publickey
 +</code>
exercises/2016_uzh_cmest/login.1474456866.txt.gz · Last modified: 2020/08/21 10:15 (external edit)