You'll have to enter the password for to perform this copy, but this should be the last time you need to do this. Now, assuming your ssh key exists on your Mac as ~/.ssh/id_rsa.pub, you can install it on a remote machine by running: cat ~/.ssh/id_rsa.pub | ssh "mkdir -p ~/.ssh & cat > ~/.ssh/authorized_keys"įor your specific server example cited above, the command would look like: cat ~/.ssh/id_rsa.pub | ssh -p 2200 "mkdir -p ~/.ssh & cat > ~/.ssh/authorized_keys" If you already have keypair you can skip the step above. When it asks if you want to protect the key with a passphrase say YES! It's bad practice to not password-protect your keys and I'll show you how to only have to enter the password once in a while. As long as they have public key authentication enabled, and your public key is present on the remote machine, you can ssh to the machines without having to supply a password.įirst you'll need to generate a public/private keypair like so: ssh-keygen -t rsaįollow the prompts. You can copy your public key to the remote machines.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |