Password less authentication to run scripts an remote server – Linux
Background Information: Public key cryptography, also known as asymmetric cryptography uses two keys, each of which can be used to encrypt a message. If one key is used to encrypt a message, then the other must be used to decrypt it. This makes it possible to receive secure messages by simply publishing one key (the public key) and keeping the other secret (the private key).
Anyone may encrypt a message using the public key, but only the owner of the private key is able to read it. In this way, Alice may send private messages to the owner of a key-pair (the bank) by encrypting it using their public key. Only the bank can decrypt it.
For more information, visit this page.
SSH pubkey authorization
For more information, visit this page.
SSH pubkey authorization
Step 1
Make yourself a pubkey/privkey pair:
Make yourself a pubkey/privkey pair:
Step 2
Rename the pubkey to authorized_keys:
Rename the pubkey to authorized_keys:
Step 3
Scp the authorized_keys file into ~/.ssh/ on all machines you want to be able to connect to. you can also use below mentioned command to copy the pubkey to remote host.
Scp the authorized_keys file into ~/.ssh/ on all machines you want to be able to connect to. you can also use below mentioned command to copy the pubkey to remote host.
Step 4
Run the ssh-agent and load your privkey into it. Use the following script, which is called “sshrun”, to do that.
Run the ssh-agent and load your privkey into it. Use the following script, which is called “sshrun”, to do that.
Step 5
Try ssh into one of the boxes in question. If it doesn’t let you in without a password, it’s probably a file or directory permissions problem.
Try ssh into one of the boxes in question. If it doesn’t let you in without a password, it’s probably a file or directory permissions problem.
No comments:
Post a Comment