User Tools

Site Tools


exercises:2017_uzh_cp2k-tutorial:login

Differences

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

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
exercises:2017_uzh_cp2k-tutorial:login [2017/06/26 08:06] – created jglanexercises:2017_uzh_cp2k-tutorial:login [2017/07/05 16:23] – [Module loading] Change CP2K version to load. agloess
Line 21: Line 21:
  
   * a file transfer tool to copy files from/to the server:   * a file transfer tool to copy files from/to the server:
-    * on Linux: put ''%%sftp://tcopt3.chem.uzh.ch%%'' as the address in your file browser and you should be able to browse your home directory after logging in+    * on Linux: put ''%%sftp://tcopt6.chem.uzh.ch%%'' as the address in your file browser and you should be able to browse your home directory after logging in
     * on Mac OS X/OSX/macOS Sierra: use [[https://cyberduck.io/|Cyberduck]]     * on Mac OS X/OSX/macOS Sierra: use [[https://cyberduck.io/|Cyberduck]]
     * one Windows: use [[https://winscp.net/|WinSCP]] or [[https://cyberduck.io/|Cyberduck]]     * one Windows: use [[https://winscp.net/|WinSCP]] or [[https://cyberduck.io/|Cyberduck]]
   * a plain text editor to edit input files if you are uncomfortable with using ''vim'', ''nano'' or ''emacs'' via SSH. Please note: It is important that your editor supports Unix line endings. If in doubt, use one of the mentioned editors on the server, or an advanced plain text editor like [[https://atom.io/|Atom]] (plus the [[https://atom.io/packages/line-ending-selector-unix|line-ending-selector-unix]] plugin) or [[https://notepad-plus-plus.org/|Notepad++]] on your local machine.   * a plain text editor to edit input files if you are uncomfortable with using ''vim'', ''nano'' or ''emacs'' via SSH. Please note: It is important that your editor supports Unix line endings. If in doubt, use one of the mentioned editors on the server, or an advanced plain text editor like [[https://atom.io/|Atom]] (plus the [[https://atom.io/packages/line-ending-selector-unix|line-ending-selector-unix]] plugin) or [[https://notepad-plus-plus.org/|Notepad++]] on your local machine.
  
-Use the instructions giving in the lecture/available via OLAT to login on the server ''tcopt3.chem.uzh.ch'' using your assigned student account. +Use the instructions giving in the lecture/available via OLAT to login on the server ''tcopt6.chem.uzh.ch'' using your assigned account.
- +
-<note important>Change the password of your account after your first login, using: +
-<code> +
-$ passwd +
-</code> +
-</note>+
  
  
 <note important>Login the remote machine using (if you use Linux or MacOS): <note important>Login the remote machine using (if you use Linux or MacOS):
 <code> <code>
-$ ssh -X username@tcopt3.chem.uzh.ch+$ ssh -X username@tcopt6.chem.uzh.ch
 </code> </code>
 </note> </note>
  
  
-===== The bash terminal===== 
  
-Many tasks in the following weeks will need to be performed on the terminal (or 'command line'). 
- 
-<note tip> 
-If you use Mac OS X: 
-In order to keep the terminal in the dock also after you close it, right click on the symbol and select 'Options' -> 'keep in dock'. 
-</note> 
- 
- 
-Let's start with a list of useful commands -- just type them into the command line and confirm with ''RETURN''. 
-<code bash> 
-ls             # get list of files in the current directory 
-mkdir molsim   # make directory 'molsim' 
-cd             # change into your home directory 
-cd molsim      # change into directory 'molsim' 
-cd ..          # go up one directory 
-pwd            # print path to the current working directory 
- 
-</code> 
- 
-Now it is time to copy some files from the teacher account. 
- 
-<code bash> 
- 
-cp ~student10/whatever.txt .               # copy 'whatever.txt' to you current folder 
-scp your_username@remotehost.edu:foobar.txt /some/local/directory  #Copy the file "foobar.txt" from a remote host to the local host 
-scp foobar.txt your_username@remotehost.edu:/some/remote/directory #Copy the file "foobar.txt" from the local host to a remote host 
-</code> 
- 
-After this, please close and reopen your terminal in order to activate the course-specific  
-settings you copied. 
- 
-We are now ready to get started. Below you find some additional commands that will come in handy later. 
- 
-<code bash> 
-vim myfile      # opens 'myfile' in vim (less intuitive but more powerful command line text editor) 
-vi myfile       # opens 'myfile' in vim (less intuitive but more powerful command line text editor) 
-</code> 
  
  
Line 106: Line 62:
  
 <code> <code>
-$ module load cp2k/r17408_2016_09_19+$ module load cp2k/r17968_2017_06_27
 </code> </code>
  
Line 157: Line 113:
 <code> <code>
 $ cp2k.sopt -i cp2k.inp -o cp2k.out & $ cp2k.sopt -i cp2k.inp -o cp2k.out &
 +$ mpirun -n $NUM_PROC cp2k.popt -i cp2k.inp -o cp2k.out &
 </code> </code>
  
Line 205: Line 162:
  
  
-===== 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/2017_uzh_cp2k-tutorial/login.txt · Last modified: 2020/08/21 10:15 by 127.0.0.1