top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How do you switch from any user to a superuser in Linux environment?

+2 votes
357 views
How do you switch from any user to a superuser in Linux environment?
posted Feb 5, 2016 by Mohammed Hussain

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

get super user(root) access, you can use one of a variety of methods:

1.Run sudo and type in your login password, if prompted, to run only that instance of the command as root. Next time you run another or the same command without the sudo prefix, you will not have root access.

2.Run sudo -i. This will give you an interactive root shell at your current directory. Note that the $ at the end of your prompt has changed to a #, indicating that you have root access. From here you can run any sequence of commands as root, or run the command exit to leave the root shell.

3.Use the su (substitute user) command to get a root shell. This is effectively the same as using sudo -i. Note that when you use this command it will ask for the root password and not your login password. These are not the same. You may have to set or change the root password by running sudo passwd root first.

answer Feb 6, 2016 by Shivam Kumar Pandey
...