Linux–How to become super user in X
There are many times when your desktop is running on Linux as a non-root user and you want to run a graphical administration program. In most cases, the GUI administration program will ask you to enter the root password. However, if for some reason it fails, here is what to do:
First, open a Terminal window on the X desktop.
Then, open permission to the X window display for everyone on the local machine by typing:
$ xhost +localhost
Type the following and enter the root password when prompted, to become super user:
$ su -
Password: *******
#
Next, type the following to see the current display value:
# echo $DISPLAY
If the value is something like :0 or :0.0, any X command that you start from the shell will appear on the console terminal for the computer. If you are at the console and that’s what you see, then you can skip the next step. If you see no value or the wrong value, you much set the DISPLAY variable.
Type the following:
# export DISPLAY=:0
At this point, you can run any administrative X command and have it appear on your X desktop. If you are running an administrative command from a remote computer and you want it to appear on your local desktop, you can set the DISPLAY to host:0, where host is replaced by the name of your computer.
When you are done, be sure to exit the application you are running. Then restore the security of your X desktop by typing the following:
$ xhost -
Tags: command, desktop, display, graphical administration, GUI, gui administration, linux, localhost, permission, remote computer, root, root user, shell, Terminal, variable, x window, xhost