Last active
July 7, 2020 08:23
-
-
Save yemreak/1f6a1be32fa024d91f60e55cfc565921 to your computer and use it in GitHub Desktop.
🔑 SSH key oluşturma ve sunucuya aktarma scripti (🐧 Linux)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
read -p 'Username: ' USER | |
read -p 'IP adress: ' IP | |
read -p 'Key ID: : ' KEY_ID | |
KEY_PATH="./.ssh/${KEY_ID}_ecdsa" | |
ssh-keygen -t ecdsa -b 521 -f ${KEY_PATH} | |
ssh ${USER}@${IP} "\ | |
mkdir -p ~/.ssh && \ | |
echo \"`cat ${KEY_PATH}.pub`\" && \ | |
chmod 700 ~/.ssh && \ | |
chmod 600 ~/.ssh/authorized_keys" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment