SSH Without A PasswordShare
When you start using SSH you’ll quickly find it asks for your password. Frequently. Murphy copies files to the web server over an SSH transport and each new copy operation prompts for a password. But it doesn’t have to be that way. Set up an SSH key pair and the keys will handle authentication.
The steps to implement your key pair are pretty straight forward. On the client computer you execute one command that generates the key pair. Then you add the contents of the public key to a file called authorized_keys2 on the server. If the file doesn’t exist on the server you can simply rename your public key file to authorized_keys2 and you’re done.
That’s it. Once the authorized_keys2 file contains your public key you can login with SSH from any machine with the private key. The logic is that only someone with proper credentials could have placed the public key in the appropriate folder on the server. And once that public key is in place only the corresponding private key will be authenticated without a password.
Here’s the really interesting thing about all these keys: You can give that same public key to as many people as you want. And even though they can all use it, and only it, to verify that you have the corresponding private key, they cannot ascertain what that private key is. The underlying technology is called asymmetric cryptography in case you want to know more.
Once you’ve set up the keys like we’ll show you in the screencast you can use other tools without passwords too, like scp and rsync for copying files. We’ll get to scp in a later screencast. Murphy introduced rsync as a way to copy an iWeb site to a third-party server.
This screencast picks up where we left off yesterday, with SSH already up and running.Watch Now | Permalink