This can be achieved either by: 1. Adding the user to the 'sudo' group 2. Editing the file /etc/sudoers using visudo. Method 1 (Ubuntu based) sudo adduser newuser
sudo usermod -aG sudo newuser |
Method 2 (Ubuntu based) Modify '/etc/sudoers' with the editor "visudo".
#Create a user called "newuser"
[root@mylinux~]#useradd newuser
[root@mylinux~]#passwd newuser
#Edit the file with visudo:
[root@mylinux~]# visudo
#Find a line 'User privilege specification' and add the following.
newuser ALL=(ALL) ALL |
Method 1 (Redhat/Fedora/CentOS) sudo adduser newuser
sudo passwd newuser
sudo usermod -aG wheel newuser |
|