40 |
40 |
41 Change passphrase of priv key:: |
41 Change passphrase of priv key:: |
42 |
42 |
43 $ ssh-keygen -p -N "newphrase" -P "oldphrase" -f ~/.ssh/id_dsa |
43 $ ssh-keygen -p -N "newphrase" -P "oldphrase" -f ~/.ssh/id_dsa |
44 |
44 |
45 Coping and deleting public keys |
45 To copy your public key to a remote host (for automatic login by a pubkey authentication):: |
46 =============================== |
46 |
47 |
47 $ ssh-copy-id $user@$host |
48 To copy your public key to remote host (for automatic login by pubkey |
|
49 authentication):: |
|
50 |
48 |
51 $ ssh $user@$host cat ">>" "~/.ssh/authorized_keys" <~/.ssh/id_rsa.pub |
49 $ ssh $user@$host cat ">>" "~/.ssh/authorized_keys" <~/.ssh/id_rsa.pub |
52 # public pub key on remote host |
|
53 |
|
54 $ ssh-copy-id $user@$host # alternative to previous command |
|
55 |
|
56 |
50 |
57 Dealing with server pubkeys |
51 Dealing with server pubkeys |
58 =========================== |
52 =========================== |
|
53 |
|
54 To remove a host fingerprint from a local ``known_hosts`` (if you changed a server pubkey or changed |
|
55 a server):: |
|
56 |
|
57 $ ssh-keygen -R hostname |
|
58 $ ssh-keygen -R hostname -f ~/.ssh/known_hosts |
59 |
59 |
60 Each SSH server keeps a single priv key, sharing a common pub key with all clients. It is an |
60 Each SSH server keeps a single priv key, sharing a common pub key with all clients. It is an |
61 identity of the server and upon a new connection you are asked to trust this pub key. After |
61 identity of the server and upon a new connection you are asked to trust this pub key. After |
62 accepting the pub key it is written to ``~/.ssh/known_hosts``. |
62 accepting the pub key it is written to ``~/.ssh/known_hosts``. |
63 |
63 |