Centos 7 – Create user root linux

adduser ben
passwd ben
y48zhssfdfsdfsfGznpu
gpasswd -a ben wheel
passwd -n 9999 ben
chage -m 99999 ben

———-Configuration file for sudos users————

visudo 

Find the following code:

## Allow root to run any commands anywhere
root ALL=(ALL) ALL

—–Add this line——

ben ALL=(ALL) ALL

SSH Alert for This USER

If you want to get SSH alert on this users connection – please login with the user & Password you created now

nano ~/.bash_profile

IP="$(echo $SSH_CONNECTION | cut -d " " -f 1)"
HOSTNAME=$(hostname)
NOW=$(date +"%e %b %Y, %a %r")

echo 'Someone from '$IP' logged into '$HOSTNAME' on '$NOW'.' | mail -s 'SSH Login Notification' [email protected]