![]() If we want our user to have access to these privileges, we need to add it to the sudo group. For example, if we want to execute a command that requires these privileges, it will list the following output: testuser is not in the sudoers file. Add the User to the sudo GroupĪs we mentioned, our new user testuser is created without administrative privileges by default. If we want to go back to the previous session, we can do that using the exit command: $ exit Step 4. If we enter the correct password, we will change the current user to our new testuser. When executing this command, the password for the testuser will be requested. The su command stands for substitute user, and it allows us to enter directly into a different user account without logging out of our currently logged in user. ![]() This is possible by using the su command. There is also a different way to quickly switch to a different user if we are already logged in to the server. Accessing the New UserĪfter we created a new system user account, we can log in with our newly created user through SSH by typing: $ ssh server_ip_address -p port_number When you enter the desired information just confirm the information by typing Y. Note that you are not required to enter information for the fields you don’t wish to populate. Changing the user information for testuserĮnter the new value, or press ENTER for the default Īfter you set the user password, the home directory will be created for that user and will prompt you to set up information for this new user. Ĭreating home directory `/home/testuser'. Output:Īdding new user `testuser' (1001) with group `testuser'. Never use passwords based upon dictionary words or significant dates. Please make sure that the password for the new user is a strong password utilizing at least 10 characters including alphanumeric and grammatical symbols. When we run this command it will request to enter information about the new user. Since we are currently logged in as a root user, we can add the new user with the following command: # adduser testuserĭo not forget to replace testuser with your desired username. This means that these users will be able to add or edit files only if they are owners of those files. When we add new users to the system, these users are by default not privileged with any administrative access. In this step, we’ll be adding a new user. Once you have logged in, you can update your Debian 9 packages to the latest version using: # apt update & apt upgrade Step 2. It maximizes security and can introduce new features to your server. It’s not a mandatory step for this tutorial, however it’s a good practice to update your server packages frequently. ssh -p port_numberĭo not forget to replace the “ server_ip_address” and “ port_number” with your actual server IP address and port number. The first thing we need to do is access the Debian server via SSH as the root user. NOTE: You will need access to the root account in order to add users to the sudo group. Connect to your server via SSH and Update your Server OS packages This should work in Debian 10 as well as other future versions of Debian, as these commands usually only have small variations over time. However, to use the sudo command, the user is required to be present in the sudo group. This benefit can be utilized using the sudo command. However, having administrative access may still be appropriate for everyday tasks – sometimes we need the power to execute some command as an administrative user. In order to reduce the risk of irreversible damage to the system, we can create a user who will not have privileges to execute commands that can affect the server. Note that Linux does not have an “undo” command. Typically, the root user is only used for administrative tasks, as there are no restrictions present like they are for any other user. This user is extremely powerful and even dangerous because it has a complete access to the server. ![]() In this article, we will show you how to add a user to the sudo group in Debian 9.Įvery time you install a fresh new operating system, a user named root is being created automatically. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |