Simple ssh without password

I have to ssh into a server where the source and destination .ssh folder was empty (but ssh was installed)

Here are the steps needed (using rsa)

locally generate and get the content of the key (line starting with ssh-rsa...)

$ ssh-keygen -t rsa
$ cat ~/.ssh/id_rsa.pub 
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDb...rGSQxR8t xxx@xxxxxx


remotely

$ cd ~/.ssh 
$ touch authorized_keys
$ chmod 600 authorized_keys

and then to append the content of the public key to the list of authorized key

$ vi authorized_keys 


In one command:

$ cat .ssh/id_rsa.pub | ssh user@host 'cat >> .ssh/authorized_keys'

Popular posts from this blog

Soving AccessDenied on Google Cloud Storage domain mapping

Fixing "DerInputStream.getLength(): lengthTag=109, too big" in Android Studio

Simple Samba setup on Lubuntu