Created
September 3, 2015 10:07
-
-
Save andriisoldatenko/52b225530a664fb7b30c to your computer and use it in GitHub Desktop.
Create new user centos 7.1 and add to sudoers
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
# 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