![]() ![]() We also saw here, how we can enable access to these commands for different users. ConclusionĪ specific shell is provided with the su command, whereas only temporary privileges are granted through sudo command. If you want to let another user have access to sudo command then, follow the article. Only the user we have created at the time of installation can have the access to sudo command. We would like to add here that, not all users have access to sudo command in Ubuntu. Otherwise, things would work just like it would for a regular user. ![]() So, through sudo command we can have superuser privileges only when we require. If we run another command in same shell without sudo, it would run as regular user. The privileges won’t be permanent with sudo. But, when we run a command through sudo, it runs the command as superuser. With su command, we were provided root’s shell which had all the privileges. sudo command is mainly used to grant temporary privileges to the regular user. Once, we have set the root password – we are good to go. Therefore, we need to provide root password first in order to make it work. Reason: root password is not set during installation setup. It would throw an error if we try to access the superuser through this method – su: Authentication failure. It is worth mentioning here that, Ubuntu may not allow you to log in through this method. So, for example – if we want to log in as root user then, we would use – su -lįor other users, following would work – su -l But, we can also use the command to log in with other users as well. su (or substitute user) allow us to log in a user through a shell.īy default it logs in as root user. Difference between su and sudo command in Ubuntu If username is not specified with su and su -, the root account is implied. In case you don’t have one then, we advise you to contact your System Administrator for assistance. The main difference is : su - username sets up the shell environment as if it were a clean login as the specified user, it access and use specified users environment variables, su username just starts a shell with current environment settings for the specified user. Note: Following operations would require you to have superuser privileges. Most of us who have access to superuser privileges would usually log in as regular user and then, use either su or sudo commands to execute administrative tasks. Therefore, we draw a line on who gets what while working on the system. Users who don’t have enough experience in handling systems may inadvertently harm the system. To make sure the system is secure enough, we can’t provide superuser privileges to every user. A system administrator gets the maximum number of privileges, this helps him/her manage the distribution better. Every user in a Linux distribution has certain privileges. In this article, we would cover the difference between su and sudo command in Ubuntu. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |