![]() That’s All! In this article, we’ve explained how to to create a new normal user account with sudo privileges on a CentOS system. How to Keep ‘sudo’ Password Timeout Session Longer in Linux.How to Show Asterisks While Typing Sudo Password in Linux.10 Useful Sudoers Configurations for Setting ‘sudo’ in Linux.You might also like to read these following related articles on sudo. You can also list the contents of the /root directory using the ls command, which is normally only reachable to the root user. If sudo is configured correctly, the output of the above whoami command will show root.ħ. You will be also be asked to enter the password for the user account. $ whoamiĪs this is the first time you have executed sudo from this account the banner message will be shown. Now run the whoami command by prepending "sudo" to the command that you wish to run with administrative privileges. Test sudo access on newly created user account tecmint by invoking the su command to switch to the new user account and also verify that the user is in the wheel group. Here, the -a flag means to append user to a supplementary group and -G specifies the group. So, next, add the new user tecmint to the wheel group using the usermod command. On all Linux distributions that belongs to the RHEL family, only users in the wheel system group can run a command with sudo. Set a password for the newly created user account using the passwd command (remember to set a secure strong password). Replace tecmint with the user name that you wish to create. # useradd -m -s /bin/bash -c "Administrator" tecmint Create a normal user account called tecmint using the useradd command, the -m option means to create the user’s home directory if it doesn’t exist, -s defines the new user’s login shell program (which is /bin/bash in this case) and -c defines a comment indicating that this is an administrative user account. ![]() ![]() Log in to your CentOS system as the root user. ![]()
0 Comments
Leave a Reply. |