Skip to content

Instantly share code, notes, and snippets.

@Utshaw
Created June 5, 2020 02:59
Show Gist options
  • Save Utshaw/7b20a327edd3eba699d36bad84e0e125 to your computer and use it in GitHub Desktop.
Save Utshaw/7b20a327edd3eba699d36bad84e0e125 to your computer and use it in GitHub Desktop.
ssh into remote machine in linux
# Let, user wants to ssh into remote machine from user machine
# User machine:
ssh-keygen
cat ~/.ssh/id_rsa.pub # then copy the content
# Remote machine
mkdir -p ~/.ssh && chmod 700 ~/.ssh ; touch ~/.ssh/authorized_keys
MY_KEY="<paste_here>"
echo "${MY_KEY}" >> ~/.ssh/authorized_keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment