Passwordless SSH Configuration
You can use your own computer for all exercises. But in addition you will also need an account on our Unix server theon:
-
For submitting your solution for a quiz (i.e. programming assignment)
-
To access some additional material, e.g. source files.
-
So that we can provide you some reference installation of certain tools (in case you have problems with a local installation).
You can use this web form to register for an account on theon. Once your account is active also register for this lecture in SLC.
scp (Secure copy)
Once the SSH configuration is complete you also can use scp (secure copy) to passwordless copy one or more files from theon to your own computer forth and back.
Usage
The usage of scp has the form
1 | scp [options] sources target
|
Hereby sources can specify a single file or a list of files. In particular you can use a wildcard like *. For example, h*.c expands to a list with all filenames that begin with an h and end on .c. The list of names in sources can refer files on a server or to local files:
-
If a name begins with “theon:”, e.g. theon:foo, it refers to the file foo on theon. The path of the file is by default relative to your home directory. So theon:hpc0/session01/foo refers to the file foo in your subdirectory hpc0/session01. And theon:hpc0/session01/foo* to all files in this subdirectory that begin with foo.
Of course, if you use an absoulte path like in theon:/home/numerik/pub/foo it refers to the file /home/numerik/pub/foo on theon.
The same syntax is used for target to specify a destination that can be local or remote. If target is a directory then files will be copied into this directory, otherwise target is used as filename for the copy.
Some examples
-
Copy the local file foo from the current directory to your home directory on theon:
1
scp foo theon:foo
or (because we don't want to change the filename) simply
1
scp foo theon:.
or even simpler
1
scp foo theon:
-
Copy the local file foo from the current directory to your home directory on theon and rename it to bar:
1
scp foo theon:bar
-
Copy from your home directory on theon the file foo to the current directory on your local machine:
1
scp theon:foo .
Copying directories: Option -r
For copying directories and all its subdirectories use the option -r (for recursive):
-
From the current directory you can copy the directory hpc0 and everything it contains to your home directory on theon with
1
scp -r hpc0 theon:
-
With
1
scp -r theon:hpc0 .
you copy the directory hpc0 from your home directory on theon to the current directory on your local computer
Exercise
Copy your directory hpc0 from your local computer to theon. Then copy it back.