Created
November 15, 2020 04:33
-
-
Save ofou/f4e1e9a8d7df43c0c5673459e03391d1 to your computer and use it in GitHub Desktop.
Add SSH Public Key to Server Manually adapted from linuxhandbook.com
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
# get the key you want to use | |
cat ~/.ssh/id_rsa.pub | |
# it will show you your public key (here's mine) | |
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCuaNEn5FIUac+j/BxTbB25eCPo9bMkpccyshA/8ZzcPmfiQevcvy506Luw4RwzApMnDewp5sYyxHiOowLbnXp3u4/+QaIgmgvgPOz34tQOj9RhRgMNtgqg1kzhfcI44DmPy3NLddesBUBJ9i3wrMkJVWQfy5YlAhp88yxiR3Ji4MWaFeIM5RP29FN3z+k+P9fB6AxEuOV2/wiCeJsivq3rY0JNLYSvw0l/w9uBk+k7hAyYaZsVmB7ThgKQm65vRWllJp7KAYIRoIfblKHUqytwLBlnDQR3PHLEGMbPa0LMEbA+IjKhSxHRulqZxIXC6LkiqZzG2vPA9/tmbkyzmFQ+Dx1yl/Q8AicH90WOD4TKUAahcd8225PkAgrOavAXq0RTE24jUkG9v3LANW4LZf5UIWShZy27mvCgiUgaZsBaodVaz9pcJT6/5WqmBQKr68mUUIqWDLhuk4z3NqrQtak7zaJ4G/Ttsdu1D/ihCZcT9PeuZpThytSqSGdlFmZ/sDC+K1T6AQ8S6DMcdiiBQHV0+3GoYj1QmRTIYu3t5Ms+vm/TxX1L7AT4IyHRQcLbrmIXtV+R2REyUwDHZ1Lnbp6gtCG2yXQ2oyy11+AZ7CiAINXwBCVqFsCcNz/TpS06pGI9KWrCAzPNig9ZzlrbjElA+FrSUJcpYbpWCPxWPbqj3Q== [email protected] | |
# Create ssh directory in the user’s home directory (as a sysadmin) | |
mkdir -p /home/user_name/.ssh && touch /home/user_name/.ssh/authorized_keys | |
# Now open this /home/user_name/.ssh/authorized_keys file with a text editor | |
# like nano and add the public key of the user here: | |
nano /home/user_name/.ssh/authorized_keys | |
# set file permissions | |
chmod 700 /home/user_name/.ssh && chmod 600 /home/user_name/.ssh/authorized_keys | |
# change the ownership to the user: | |
chown -R username:username /home/username/.ssh | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment