pondělí 25. listopadu 2013

SSH: setup public key based authentification

generate public/private key pair:
ssh-keygen -t dsa

set correct permissions of the ~/.ssh directory
chmod 700 ~/.ssh && chmod 600 ~/.ssh/*

transfer your public key to a new server:
cat ~/.ssh/id_dsa.pub | ssh user@server \
        'mkdir -p .ssh && cat >>.ssh/authorized_keys && \
         chmod 700 .ssh && chmod 600 .ssh/*'

Ensure that permissions of the ~/.ssh directory are correct (as above).

1 komentář:

  1. Thanks, its simple and nice. However, that command is missing in OSX.
    Of course, this should be "Linux" blog, but who cares;-).

    OdpovědětVymazat