
This step will prevent a new user created with the same name from being accidentally given sudo privileges. Or use this command if you are a non-root user with sudo privileges:ĭerek ALL=(ALL:ALL) ALL # DELETE THIS LINE If you previously configured sudo privileges for the user you deleted, you might want to remove the relevant line again by typing: If you're running this as a non-root user with sudo privileges, you would instead type: If you prefer to delete the Derek's home directory when “derek” is removed, you can issue the following command as root: If you are signed in as another non-root user with sudo privileges, you could instead type: When Derek is done using the account you should delete him (me) from the account without deleting any of his files, by typing this as root:
#SU VS SUDO PASSWORD#
If your user (derek) is assigned to the correct group and you entered the password correctly, the sudo issued command should run with root privileges. The first time you use sudo in a session, the system will prompt you for the password of the user account.As the new user, verify that you can use sudo by adding "sudo" to the beginning of the command that you want to run with superuser privileges.Use the su command to switch to the new user account.Use the “usermod” command to add the user to the sudo group.īy default, on Ubuntu, members of the sudo group have sudo privileges.Ĥ. (enter the new value, or press ENTER for the default)ģ. You can opt to accept the defaults to leave all this information blank.Ĭhanging the user information for username: Follow the prompts to set the new user's information.I highly recommend that you use a secure password when setting this up.



Some types, such as Fedora, Red Hat, and openSuSE enable the root user, while others, such as Ubuntu and Debian, do not. Which one you use will depend on which type of Linux you have. You can either change over to the super user, also known as the root account, using the “su” command, or you can use the “sudo” command. When it comes to working with Linux, there are two ways to run administrative applications.
