Simple HOW TO’s … How to setup a Passwordless SSH
Simple HOW TO’s …
How to setup a Passwordless SSH:
from source:
1. Generate source key on root account...
# ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
key fingerprint is:
6f:c5:86:c7:67:69:02:1a:e4:a9:20:e6:16:13:5d:e5 admin1@gohan
2. vi /root/.ssh/id_dsa then copy all content to notepad (need to be one-liner only)
from destination:
3. Do the following
# cd
# mkdir -p .ssh
# chmod 700 .ssh
# vi .ssh/authorized_keys ;then paste key generated from source then save
# chmod 600 .ssh/authorized_keys
DONE!!!
Shortcut:
cat ~/.ssh/id_dsa.pub | ssh user@remotebox "(mkdir .ssh&>/dev/null; chmod 700 .ssh && cat - >> .ssh/authorized_keys )&&chmod 600 .ssh/authorized_keys"
How to setup a Passwordless SSH:
from source:
1. Generate source key on root account...
Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
key fingerprint is:
6f:c5:86:c7:67:69:02:1a:e4:a9:20:e6:16:13:5d:e5 admin1@gohan
2. vi /root/.ssh/id_dsa then copy all content to notepad (need to be one-liner only)
from destination:
3. Do the following
# cd
# mkdir -p .ssh
# chmod 700 .ssh
# vi .ssh/authorized_keys ;then paste key generated from source then save
# chmod 600 .ssh/authorized_keys
DONE!!!
Shortcut:
cat ~/.ssh/id_dsa.pub | ssh user@remotebox "(mkdir .ssh&>/dev/null; chmod 700 .ssh && cat - >> .ssh/authorized_keys )&&chmod 600 .ssh/authorized_keys"