Skip to content

Instantly share code, notes, and snippets.

@milnomada
Created June 6, 2018 11:14
Show Gist options
  • Save milnomada/1a071a0f80bedc6bd1ebe6f2f57ac4e5 to your computer and use it in GitHub Desktop.
Save milnomada/1a071a0f80bedc6bd1ebe6f2f57ac4e5 to your computer and use it in GitHub Desktop.
Add Ubuntu user with ssh access
# remote
user=username
host=192.168.2.2
adduser $user
sudo usermod -aG sudo $user
# local
key_name=rsa
cd .ssh
ssh-keygen -f "id_$key_name" -b 2048 -q
ssh-copy-id -i "id_$key_name.pub" "$user@$host"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment