![]() rw-rw-r- 1 abhishek abhishek 0 Aug 23 07:56 hope you like this handy Ubuntu tutorial. The command should be a single argument and hence you should keep it under quotes. You can use the -c and run the given command as another user: su -c command_to_run user_name If the entire idea of switching to another user is to run a command, you don't necessarily change the user accounts. password for Bonus tip: Run a command as another user When asked for the password, enter your account's password: sudo su When asked, enter the root password: you don't know the root password but have sudo access (default sudo configuration that comes in most Ubuntu system), you can switch to the root user like this: sudo su If you know the root password, you can switch to root user simply with: su When I am using the ubuntu operating system, the most thing I use is a terminal/shell. ![]() Since we are discussing the su command here, let's use that only. There are several ways to switch to the root user. You can switch back to your logged-in user by entering: exit If you are running as the root user, you can simply switch to the other user with its name: su other_username You can list the users in Ubuntu with the following command and get the desired username from the bottom of its output: compgen -u Switching to a normal user from root user □️ You need to know the exact username to which you need to switch to. Intrigued? Let's see all the above in detail, along with a few additional tips and use cases on switching users in Ubuntu. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |