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...)
remotely
In one command:
$ cat .ssh/id_rsa.pub | ssh user@host 'cat >> .ssh/authorized_keys'
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'