Passwordless ssh
|
From Linuxconfig.org
To be able to remotely login to ssh without a password you need to generate public keys and copy them to a remote box. Try creating a passwordless connection from linuxconfig.local to linuxconfig.org. In this example you will create keys for the root user, also note that the exact same principles apply to any user created in the system.
Contents |
Example
generate RSA keys with ssh-keygen
# ssh-keygen -t rsa
generate DSA keys with ssh-keygen
# ssh-keygen -t dsa
Create authorized_keys file
This file contains newly created public keys(*.pub). Please note that you are using a root account and all the keys are by default in the /root/.ssh directory.
# cd .ssh # cat id_dsa.pub > authorized_keys; cat id_rsa.pub >> authorized_keys
Copy authorized_keys to remote box
Make sure you copy the authorized_keys file to an appropriate user's home directory.
# scp authorized_keys root@linuxconfig.org:~/.ssh/
Login to remote system
Note that no password is required.
# ssh linuxconfig.org


















