SSH How to connect without password

A classic hack for linux users, connect via ssh without password.

First, on your client, generate public key

ssh-key-gen -t rsa

keep ~/.ssh/id_rsa by default.

Copy public key (~/.ssh/ from your client to the file ~/.ssh/authorized_keys2 on the server with the ssh-copy-id binary.

Then edit your ~/.ssh/config file on client side to custom your params:

Host dev
  Port 22
  User root

Finaly, you can add an alias in your ~/.bashrc

alias dev='ssh dev'

Now, to launche a ssh connection, just run


Leave a Reply