Instead of using a password, 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_rsa): '''<just hit enter>'''

+

Enter passphrase (empty for no passphrase): '''<use a non-empty pass''phrase''>'''

+

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/id_rsa.pub.

+

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 | use a passphrase for your key, not a password. It should contain ''multiple words'' (i.e. a phrase). [https://en.wikipedia.org/wiki/Passphrase#Compared_to_passwords Learn more about passphrases]. ([http://xkcd.com/936/ relevant xkcd comic])}}

Now you should have two keys: a public key at <code>~/.ssh/id_rsa.pub</code> and a corresponding private key at <code>~/.ssh/id_rsa</code>. 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 user@ssh.linux.ucla.edu

+

+

Consider using <code>ssh-agent</code> so you don't have to type your passphrase every time you use your private key. In most modern desktop environments (e.g. GNOME, KDE) this is handled in a GUI pop-up when you first use your private key.

+

+

Type <code>man ssh-keygen</code>, <code>man ssh-copy-id</code>, or <code>man ssh-agent</code> to see the complete manuals for these tools.

Now you should have two keys: a public key at ~/.ssh/id_rsa.pub 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 user@ssh.linux.ucla.edu

Consider using ssh-agent so you don't have to type your passphrase every time you use your private key. In most modern desktop environments (e.g. GNOME, KDE) this is handled in a GUI pop-up when you first use your private key.

Type man ssh-keygen, man ssh-copy-id, or man ssh-agent to see the complete manuals for these tools.