Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo "Connect to an SSH server in order to add your public key to the servers ~/.ssh/authorized_keys"
- echo "[SSH] Connect to: "
- read serverIP
- echo "[SSH] Login as: "
- read serverUser
- echo Pushing ~/.ssh/id_rsa.pub to $serverUser@$serverIP ~/.ssh/authorized_keys
- cat ~/.ssh/id_rsa.pub | ssh $serverUser@$serverIP 'cat >> ~/.ssh/authorized_keys'
Add Comment
Please, Sign In to add comment