SSH Without a Password
You can ssh from one box to another without typing in your password. This is done using a key pair. One key sits on the computer A, the other on computer B. Starting logged into computer A, here’s how you do it:
ssh-keygen -t dsa ssh B mkdir ~/.ssh/ cat .ssh/id_dsa.pub | ssh B 'cat >> .ssh/authorized_keys'
When you run ssh-keygen, do not use a passphrase, just press enter. Also, change the bold B to the name or IP of computer B. If you were successful, you should be able to `ssh B` without a password.
To repeat for another computer, do not repeat ssh-keygen, just repeat line 2 & 3. If you run ssh-keygen again, your key will be overwritten and you’ll need to copy it again via line 3.
Using keys is an excellent security measure. You can even setup sshd to only allow keyed logins. No passwords allowed. If you do set this up, make sure you have physical access or a rescue/remote console or you’ll be locked out if you lose your key.
Related posts:
- Laptop Fn Keys On a laptop, there are a few keys that have...
- X11 Forwarding A few days, I moved my desktop computer out into...
- Networking Day 4: Wireless Router Setup This entry is part of a series, Networking» A wireless...
Related posts brought to you by Yet Another Related Posts Plugin.