# usermod -aG sudo newuserĬreate a new user account using the command useradd. Enter the user information for newuserĮnter the new value, or press ENTER for the defaultĪdd User to the sudo group. The next step is to enter basic information about the user’s account such as name, phone number, etc. Make sure to use a strong password for your account. Adding user `newuser’…Īdding new user `newuser’ (1001) with group `newuser’ …Ĭreating home directory `/home/newuser’ … Make sure that the password for the new account is as strong as possible. *You will be prompted to set and confirm the new user password. You need to replace newuser with the real username that you want to create: # adduser newuser # su - newuserĬreate a new user account using the command adduser. So, need to add the new user to this group so it can run commands as superuser. Passwd: all authentication tokens updated successfully.īy default, the wheel group is a special user group that allows all members in the group to run all commands on CentOS systems. # useradd newuserĬreate a strong password for the user. You need to replace newuser with the real username that you want to create. # ssh _ip_addressĬreate a new user account using the command useradd. The below steps can be followed to create sudo users with Sudo privileges for CentOS, Ubuntu & Debian.Īccess the server using SSH. This largely helps in increasing system security as well as accidental changes were done to the system. It runs a single command and requires only the current user password to switch to the root user. As long as the username is present in the sudoers file, sudo command can be used to execute commands with root user privileges. Sudo command allows users to execute the programs with the privileges of other users, especially the default root user.
2 Comments
|