1 Answer
To add a user and assign a password for the user
useradd <username>
passwd <username>
if you want to add an existed user into the wheel group,
usermod -aG wheel <username>
if you want to add a new user and also at the same time wanted to add a user into the wheel group,useradd -G wheel <newuser>
passwd <newuser>
after setting the password, switch over to the user's accountsu - <usernane>
Now execute the command with sudo as follows:sudo ls -la /root
It prompts for a current logged in user's password.enter the password once to view the output of the command that you requested.
Thus user has got the root privilges and added into the wheel group.
Your Answer
x