password-less ssh between linux machines

this was a pretty popular howto article i wrote a while ago to my old blog which is now offline. hence i copied it here in case anybody still needs it.

the ssh autologin with putty article is another of these old posts i've rescued

ssh auto login under Linux

to be able to connect to an other linux box from one box without entering your password all the time do the folowing:

login to the connecting computer as the user who will later connect to the other box. execute

ssh-keygen -t rsa

and accept all defaults. you must leave the passphrase blank as well, otherwhise you’re going to be asked for that all the time, so it doesn’t do any good.

now you should have some files in your user’s home directory in .ssh/


now we need to copy (your public key) to the server you want to connect to. to connect to the server, you have to use the user you want to be logged in as later on.

scp .ssh/ username@server:~/

now connect to the server through ssh and add the contents of the copied file to your ~/.ssh/authorized_keys if this is the first time you do that, then you have to create both, the directory and the file.

ssh username@server
cat >> .ssh/authorized_keys

and now you should be able to login through

ssh username@server 

without a password prompt. if it does not work i occasionally had to use the filename authorized_keys2 instead of the one above, so maybe try adding that number on the end of the file name. other than that it should work like that. I've done it on many different distributions for quite some time now and it always worked this way.

more detailed infos in german can be found here:

  • password-less_ssh_between_linux_machines.txt
  • Last modified: 25.10.2023 11:11
  • by Pascal Suter