Skip to content

Instantly share code, notes, and snippets.

@josephphyo
Created November 30, 2019 15:45
Show Gist options
  • Save josephphyo/a9f0e023c27f6102d2bd1cb00c5a9675 to your computer and use it in GitHub Desktop.
Save josephphyo/a9f0e023c27f6102d2bd1cb00c5a9675 to your computer and use it in GitHub Desktop.
Managing User Accounts on Linux Instance - https://amzn.to/34AAx6x
1.Creating a User Account
#useradd user1
2.Add the SSH public key to the user account. First create a directory in the user's home directory for the SSH key file, then create the key file, and finally paste the public key into the key file.
#cd /home/user1
#mkdir .ssh
#cd .ssh
#vim authorized_keys (Paste user public key in this file)
3.Setup permission
#chmod 600 authorized_keys
#cd .. && chmod 700 .ssh
#chown -R user1:user1 .ssh
4.Put user to Wheel Group (For Sudo)
#usermod -aG wheel user1
#passwd -d user1
5.Login with new user
#ssh -i user1.pem user1@serverip
#sudo -i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment