You can use this user account to execute administrative commands without a need to log in to your Debian server as a root user.Īs you may already know, when we mention the Linux operating system, we are talking about a collection of Linux distributions that are using the Linux kernel. In this guide, we will show you how to create a new user on a Debian system and give it sudo access. ![]() Therefore, giving root user access out is not the best way to go. Giving complete control over your Linux server to other users is not something many server owners wish to do. You have learned how to add a regular use to the sudo group in Debian.List of content you will read in this article: sudo apt updateĪnd this brings the tutorial to an end. ![]() In the example below, I’m updating the system, so I have to invoke the sudo command. ![]() Thereafter, provide the user’s sudo password and hit ENTER. In this case, the command will be: su - you invoke sudo for the first time, you will get a brief summary of things to keep in mind. To switch to the new user, use the syntax: Linuxbuzz : linuxbuzz the output, you can see that the user now belongs to two groups: linuxbuzz and sudo. You can verify that the user has been added to the sudo group by running the command: groups linuxbuzz These options should go hand in hand.Ībove command can also be executed as: usermod -a -G sudo linuxbuzz Meanwhile the -G option defines the group to which the user will be added. The -a option adds the newly created user to the sudo group without removing it from its default group. In our case, this will be: usermod -aG sudo linuxbuzz To add the regular user to the sudo group, use the usermod command as shown: To Install sudo, run # apt install -y sudo When we do minimal installation of Debian then, sudo package will not installed during the default installation, so first we must install sudo package and then we can add users to sudo group. Step 3) Adding the user to the sudo group Finally, press Y to save the information provided.Īt this point, the regular user is created along with the necessary files placed in the user’s home directory. You can fill in the details or simply hit ENTER to leave the fields blank. You will also be prompted to specify the user’s information. To complete the process, provide a strong password for the new user – one that contains a combination of uppercase & lowercase characters, numeric and special characters. Thereafter, a home directory for the new user will be created and several files copied from the /etc/skel directory to the home directory of the user. Also, a group is automatically created for the new user along with a group ID (GID) based on the username of the user. The command creates a new user and assigns a user ID (UID) to the new user. ![]() To create a new user, use the adduser command followed by the username of the new user as shown.įor example, to add a user linuxbuzz, execute the command: adduser linuxbuzz Once you logged in, then switch to root user by running following command, su Step 2) Create a new regular user $ ssh you can use an ssh client like Putty or MobaXterm especially if you are working on a windows environment.įor putty, simply provide the IP address and hit ENTER.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |