Skip to content

Instantly share code, notes, and snippets.

@andriisoldatenko
Created September 3, 2015 10:07
Show Gist options
  • Save andriisoldatenko/52b225530a664fb7b30c to your computer and use it in GitHub Desktop.
Save andriisoldatenko/52b225530a664fb7b30c to your computer and use it in GitHub Desktop.
Create new user centos 7.1 and add to sudoers
# based on this
# https://wiki.centos.org/HowTos/Network/SecuringSSH
# https://www.digitalocean.com/community/tutorials/how-to-add-and-delete-users-on-a-centos-7-server
# Create user
sudo adduser newuser
sudo /usr/sbin/visudo
sudo passwd newuser
sudo gpasswd -a newuser wheel
sudo lid -g wheel
ssh localhost
exit
ls -la ~/.ssh/
touch ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
vim ~/.ssh/authorized_keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment