ssh access without password

I'd say the safest solution to this is to generate a password-less SSH-key for each machine and add it to the authorized_keys list on the other.

On machine 1 (as the user who's logging on to the other server):

$ ssh-keygen -t rsa
$ ssh-add ~/.ssh/id_rsa
$ cat .ssh/id_rsa.pub

If keygen asks you for a password, just press enter to create a password-less key.

On machine 2:

  1. Create or edit ~/.ssh/authorized_keys for the user that you're logging in with.
  2. Add the contents of id_rsa.pub (make sure it's the .pub file, not the private key) to the file. All of id_rsa.pub should fit on a single line.

When this is done you should be able to do this from machine 1:

$ ssh username@machine-2

and just be logged in without entering your password. Same goes for scp/sftp.

If this doesn't work, make sure that you have PubkeyAuthentication yes in your /etc/ssh/sshd_config


Keep in mind that this is a serious security risk, so you definitely want to do this in a restricted environment, running under a restricted shell or for chrooted accounts only. @Kimvais suggestion of scponly is on the right track.

In the client create a .ssh/id_rsa key with an empty passphrase -- this will create an unencrypted private key. Then copy the .ssh/id_rsa.pub from the client into .ssh/authorized_keys in the server -- watch out for the right permissions! (0700 for .ssh, 0600 for .ssh/authorized_keys).

Now you can ssh/scp/sftp into the server without typing a passphrase.