Secure Shell

From Wiki | LUG@UCLA
Revision as of 15:00, 7 June 2013 by (Talk)

Jump to: navigation, search

Secure Shell (SSH) is an Internet communication protocol used to exchange data between two computers using a secure channel.

Members can access their LUG account remotely via SSH.


Note Note: in the following examples, remember to replace "user" with your actual LUG username.

From the terminal

To initiate a normal SSH session from a remote terminal (e.g. your laptop):

 $ ssh

or if you want X forwarding:

 $ ssh -X

To transfer files and directories, use "scp <from> <to>".

scp from server to local:

 $ scp ~/Documents
 $ ls ~/Documents
 ... homework1.txt ...

scp from local to server:

 $ scp ~/Documents/lug.jpg
 $ ssh ls ~/
 ... lug.jpg ...

Type "man ssh" or "man scp" to see a complete user manual for these tools.

From the GUI

KDE (Linux) GNOME (Linux) Windows Macintosh
  1. open Dolphin
  2. Add Entry to Places panel
  3. in "Location" enter: fish://
  1. open File Manager
  2. click "Connect to Server"
  3. enter: s
  4. optionally bookmark the server
  •  ???

Using SSH keys

Instead of using password authentication, you can use SSH keys to authenticate with your account.

Run the following interactive command to generate an SSH key pair:

$ ssh-keygen

Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_ecdsa): <just hit enter>
Enter passphrase (empty for no passphrase): <use a non-empty passphrase>
Enter same passphrase again:
Your identification has been saved in /home/user/.ssh/id_rsa.
Your public key has been saved in /home/user/.ssh/
The key fingerprint is:
7a:15:03:8c:e6:0e:ae:06:c2:e1:8d:0a:11:b6:7e:5e user@hostname
The key's randomart image is:
+--[ RSA 2048]----+
|       o.        |
|..    o ..       |
|...  o    o      |
|.o  . .    o     |
|+.+. o  S .      |
|+= o.E.. .       |
|+.o.. . .        |
|. o.   .         |
| .               |

Note Note: please use a passphrase for your key. It should be multiple words (aka a phrase). Learn more about SSH key passphrases.

Now you should have two keys: a public key at ~/.ssh/ and a corresponding private key at ~/.ssh/id_rsa. Do not share your private key with anybody. Your public key can be copied to any remote account that supports SSH and you will be able to use your private key to authenticate with it.

E.g., copy your public key to your LUG@UCLA account:

$ ssh-copy-id

That's all!

Available software

Operating System

Debian stable

Installed Packages

Name Executable Notes
GCC gcc
Python python
OpenJDK java version 6
OCaml ocaml
GNU Prolog gprolog
Racket racket for programming in Scheme
CLISP clisp for programming in Common Lisp
GNU Octave octave a full-featured alternative to MatLab
LaTeX latex, pdflatex document creation done right
Vim vim the most powerful text editor
GNU Emacs emacs the most powerful text editor
Git git
Mercurial hg