Created
June 6, 2018 11:14
-
-
Save milnomada/1a071a0f80bedc6bd1ebe6f2f57ac4e5 to your computer and use it in GitHub Desktop.
Add Ubuntu user with ssh access
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
# 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