Accessing Network Resources¶
Login via ssh
¶
SSH, or secure shell the most common way to access remote Unix/Linux servers over the network. It works by tunneling a shell session through SSL, allowing users to logon to remote machines with a secure protocol. We saw this already in the git section. In this section we’ll take a look at how to use SSH to log in to the Hummingbird compute cluster.
Open a terminal.
In the terminal, type in
$ ssh [email protected]
where
yourID
is your CruzID. To authenticate you need to provide your blue password. As an additional layer of security Hummingbird is only accessible from the campus network. If you want to access it you will need to first get on the VPN. (You may need to use the VPN even when you are on campus.) See this page for more information regarding the VPN.If your login is successful you should see something like the following on your terminal:
Last login: Sun Oct 02 03:52:34 20xx from xxx.xxxx.ucsc.edu
Computer technical support requests can be submitted via the web here or by e-mailing
help@ucsc.edu
Note: Running code on Hummingbird (and most clusters like it) requires you to use the job submission system. This is because the cluster is a shared resource that many people rely on. Please visit the Hummingbird website for more information, or talk to the instructor.
File transfer via scp
¶
There are many cases where you want to transfer files from host machine A
to remote machine B. scp
is a command for secured copy that allows
you to transfer data using the same authentication and security as ssh
.
Let’s say I want to transfer
fileA
, which resides in the directory/Users/alberteinstein/Documents/
on the local machine, to a sub directory of theHOME
directory on Hummingbird$ cd /Users/alberteinstein/Documents/ $ scp fileA [email protected]:~/am129/
The path after the colon is expanded relative to the user initiating the transfer.
If I would want to transfer multiple files,
fileA
,fileB
, etc., I just list all of them afterscp
$ scp fileA fileB [email protected]:
Transfers in the other direction work in exactly the same way, jut list the remote first:
$ scp [email protected]:~/am129/ fileA
File transfer via sftp
¶
sftp
command is another similar protocol as scp
for file transfer,
but allows more interactive commands such as generating new directories,
deleting and moving files as well. It is particularly helpful for moving
lots of files. For more details, please see
article-sftp. Note that on Hummingbird there is a special
node to handle sftp
requests. See the Hummingbird pages for more
information.
Syncing files via rsync
¶
rsync
is not a secured file transfers between the two computers.
However, it provides a consistent way to maintain files in a two different
locations. Please see more on
wiki-rsync. There are ways to
tunnel rsync
through ssh
, but it more suited to situations
where you control both machines, and if you control Hummingbird then
you probably don’t need these notes in the first place.