Look, no password!
Wednesday, June 24th, 2009We’re using ssh with public keys quite often. One thing I always missed on OS X was the ssh-copy-id script. Its job is to take the public key of the user running the script and helping to copy that over to a server, so that the user doesn’t have to enter the password all the time. It’s a great time saver and allows you to secure the accounts with harder passwords (instead of using the same password for all accounts, like you do).
Github has a nice guide how you can create a public key, in case you don’t have one. Now, grab a copy of the ssh-copy-id script from the openssh package (for example from here). Copy it into /usr/local/bin and chmod it:
sudo cp ssh-copy-id.sh /usr/local/bin/ssh-copy-id
sudo chmod a+x /usr/local/bin/ssh-copy-id
Then you can use the following command (you’ll have to enter the password one last time)
ssh-copy-id user@machine.com
The thing tells you to check which keys you copied, so have a look at .ssh/authorized_keys after the act. Do that, it’s wise. And change your silly password into something more complicated.
By the way – we have a piece of software blocking all IPs which try to log in using passwords more than five times in a row. And it happens dozens of time a day.
