Sunday, November 23, 2008

SSH without password

You can access your remote Linux server over SSH without password. This is faster and some cases prefered way.

The goal is in generating of pair of public-private keys which will authorize your access. You will leave your private key on your local computer (kept in secret) and copy public key to any remote server you want to access. After registering the public key you will be able to access remote server without entering passowrd.


Generate public-private key pair on your local Linux desktop:
$ ssh-keygen -b 2048 -t dsa

Distribute your public key to remote server:
$ scp ~/.ssh/id_dsa.pub \
user@server.com:.ssh/id_dsa.pub.tmp


or alternatively you can use:
ssh-copy-id -i ~/.ssh/id_dsa.pub user@server.com

Register your public key on your remote server:
$ ssh user@server.com
$ cat ~/.ssh/id_dsa.pub.tmp >> ~/.ssh/authorized_keys2


Access your remote server without password:
$ ssh user@server.com

step by step guide in Czech

No comments: