ssh.rst
changeset 2555 70383fa8bf12
parent 2554 c83fb8d3809f
child 2585 9b1f7faff31c
equal deleted inserted replaced
2554:c83fb8d3809f 2555:70383fa8bf12
    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 
    72 
    72 
    73 To ensure MD5 output format (which is usually displayed with vast majority of existing SSH
    73 To ensure MD5 output format (which is usually displayed with vast majority of existing SSH
    74 clients)::
    74 clients)::
    75 
    75 
    76   ssh-keygen -E md5 -lf <(ssh-keyscan $HOST 2>/dev/null)
    76   ssh-keygen -E md5 -lf <(ssh-keyscan $HOST 2>/dev/null)
    77 
       
    78 To remove ``known_hosts`` key (it is usually needed if you change a server pubkey or change a
       
    79 server)::
       
    80 
       
    81   $ ssh-keygen -R hostname
       
    82   $ ssh-keygen -R hostname -f ~/.ssh/known_hosts
       
    83 
    77 
    84 Disabling pubkey
    78 Disabling pubkey
    85 ================
    79 ================
    86 ::
    80 ::
    87 
    81