Accessing the Network Resources

Login via ssh

Basic syntax

SSH, or secure shell is one of the most common way to access remote Unix/Linux servers over the network by allowing users to logon to the servers with a secure protocol.

In this section we take a look at how to logon to the Grape AMS Lunux server remotely.

  • The first step is to open a terminal.

  • In the terminal, type in

    $ ssh yourID@grape.soe.ucsc.edu
    

    where yourID is your SOE login ID. You are going to be asked to type in your SOE password for a successful login.

  • You can also include -X or -Y after ssh in order to allow X11 Forwarding to view a remote system’s graphical user interface (GUI) getting forwarded on to your local system

    $ ssh -Y yourID@grape.soe.ucsc.edu
    
  • If your login is successful you should see something like the following on your terminal

    Last login: Sun Apr 02 17:52:34 2018 from mongchi.soe.ucsc.edu
    
    Computer technical support requests can be submitted via the web at
         https://itrequest.ucsc.edu
    
    or by e-mailing
         help@ucsc.edu
    
    **********************************************************
    
    Online documentation for the grape cluster can be found at
         http://grape.soe.ucsc.edu
    
    Grape cluster is using the infiniband fabric.
    
    **********************************************************
    
    Some Torque commands
    
    qsub        --> Submits a job (create a shell script, then run qsub shellscript)
                    use the -q option to specify which queue to use
    qdel        --> Delete a job
    qstat       --> see the status of jobs in the queue
    qstat -Q    --> List of usable queues
    pbsnodes    --> List status of all compute nodes
    
    
    *********************************************************
    
    There are currently 4 queues on Grape
    
    orig   -  compute-0-0-compute-0-4  PowerEdge 1950
              Intel(R) Xeon(R) CPU 2.33GHz 15G MEM
    
    new    -  compute-0-5-compute-11  Dell PowerEdge R610
              Intel(R) Xeon(R) CPU 2.40GHz 15G MEM
    
    newest  - compute-0-12-compute-0-19  PowerEdge R420
              Intel(R) Xeon(R) CPU 2.30GHz 32G MEM
    
    default - includes all of the nodes.  This is the
              default queue.
    
    **********************************************************
    

Login into SSH with Keys

One can set up key-based authentification once which can be very useful to log in to a remote machine without typing in password in every login. To see more details, please read this article:ssh-key, and this youtube:ssh-key and this youtube:ssh-key 2

File transfer via scp

There are many cases where you want to transfer files from host machine A to host machine B. scp is a command for secured copy that allows you data transfer and provide the same authentication and same level of security as ssh.

  • In the following examples we assume I am transfering fileA that resides in the directory /Users/ylee/Documents/ in your local machine, to my HOME directory /soe/ylee/ams129/ on Grape

    $ cd /Users/ylee/Documents/
    $ scp fileA ylee@grape.soe.ucsc.edu:~/ams129/
    

    The last line can be also replaced with the command with a full explicit path

    $ scp fileA ylee@grape.soe.ucsc.edu:/soe/ylee/ams129/
    
  • In case if I just want to transfer fileA to my HOME directory (which is /soe/ylee instead of /soe/ylee/ams129/), it can simply be

    $ scp fileA ylee@grape.soe.ucsc.edu:
    
  • If I would want to transfer multiple files, fileA, fileB, etc., I just list all of them after scp

    $ scp fileA fileB ylee@grape.soe.ucsc.edu:
    
  • If I want to transfer fileA to Grape in a different name, say, fileC in HOME directory:

    $ scp fileA fileB ylee@grape.soe.ucsc.edu:~/fileC
    

File transfer via sftp

sftp command is another similar protocol as scp for file transfer, but also can be used to allow more interactive commands such as generating new directories, deleting and moving files as well. For more details, please see article-sftp.

Syncing files via rsync

rsync is not a secured file transfers (or syncs) between the two remote computers. However, it provides a consistent way to maintain files in a two different locations. Please see more on wiki-rsync.