============================== Passwordless SSH Configuration [TOC] ============================== 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__. ---- VIDEO ------------------------------ https://www.youtube.com/embed/rF187vJoSps ----------------------------------------- __Slides__ 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. ---- VIDEO ------------------------------ https://www.youtube.com/embed/uZb8SP67knc ----------------------------------------- Usage ----- The usage of `scp` has the form ---- CODE ------------------ 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`: ---- CODE ---------- scp foo theon:foo -------------------- or (because we don't want to change the filename) simply ---- CODE ---------- scp foo theon:. -------------------- or even simpler ---- CODE ---------- scp foo theon: -------------------- - Copy the local file `foo` from the current directory to your home directory on `theon` and rename it to `bar`: ---- CODE ---------- scp foo theon:bar -------------------- - Copy from your home directory on `theon` the file `foo` to the current directory on your local machine: ---- CODE ----- 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 ---- CODE -------- scp -r hpc0 theon: ------------------ - With ---- CODE --------- 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. :links: this web form -> https://anmelden.mathematik.uni-ulm.de/cgi-bin/slcreg scp \(secure copy\) -> https://en.wikipedia.org/wiki/Secure_copy_protocol register for this lecture in SLC -> https://slc.mathematik.uni-ulm.de/portal/catalog/details/term/SS2022/lecture/993 Slides -> https://www.mathematik.uni-ulm.de/numerik/hpc/ss22/hpc0/slides/HPC0 Passwordless SSH.pdf