Skip to content
mengfung.com
writing

ADD NEW USER CENTOS, ADD TO SUDOER, ADD RSA KEYS

 ·  1 min read
#as root
sudo su -
adduser username
visudo
# search for root
/root
# esc keypress n
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
username ALL=(ALL) NOPASSWD:ALL
# OR
visudo username ALL=(ALL) NOPASSWD:ALL
#exit
# su – to setup right user environment
su – username
ssh-keygen -t rsa -b 4096
# enter enter enter
cd ~/.ssh
touch authorized_keys
chmod 0700 authorized_keys
vi authorized_keys
# get the pub keys from your development computer
# less ~/.ssh/id_rsa.pub
# paste into authorized_keys
# from your dev computer
# ssh username@url