LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Quickly switching to root (https://www.linuxquestions.org/questions/linux-newbie-8/quickly-switching-to-root-298918/)

artificialGekko 03-07-2005 08:00 PM

Quickly switching to root
 
I know that I can switch to the root account in the bash by typing "su - root".
If I do so, am I root on the computer in general then until I log out again - or only in that bash-window? And, if that's the case, is there any quick and easy way to switch to root in the GUI too?

FrayAdjacent 03-07-2005 08:36 PM

You can open a terminal session and SU to run commands from there. Otherwise, I think you can CTRL+ALT+F5 to bring up a full screen session.

artificialGekko 03-07-2005 08:47 PM

The full screen session works with Alt+Ctrl+F2 - but I mainly want to know if there's an easy way to switch to root in the GUI to have the comfortable file-manager to move and copy files :)

FrayAdjacent 03-07-2005 08:49 PM

I'm not too sure as I'm a noob to Linux too, but I thought if you su in a terminal window, you are effectively su'd for the whole session, until you issue the 'exit' command in the terminal session.

El Basto 03-07-2005 11:22 PM

If you are root in the console, only things launched from the console will run as root. The GUI and everything launched from the GUI is still running as the normal user. If you want the GUI to be running as root, you have to log out (or at least switch user) and log into the GUI as root. But that is highly unrecomended. You can do serious damage, or so I have heard. What applications do you want to run as root?

OldPlanet 03-08-2005 02:17 AM

If you want to run your GUI filemanageras root, just run SU in a terminal and then start the filemanager from the terminal.

enemorales 03-08-2005 03:56 AM

Yeps, you are root only in that console. That's a lot more flexible and secure ;-). If you need several xterms as root, you could make a shortcut to run a xterm as root (ok, you will need to provide the password every time, but you will save some seconds ;)). If you need to run some programs every time you use your computer, you can create an init script...

artificialGekko 03-08-2005 08:24 PM

Mainly I want to switch to root comfortably in the GUI to have the interface for filemanagement like moving files, copying stuff around etc.
I'm using the console to do that as often as possible to accustom to using the text-commands - but as of now I'm still rather slow when moving stuff over several layers in the file-tree or manipulating a lot of files... ;)

However, having to logout and login again as root is too much of a hassle for my taste, so I guess I'm just gonna practice more with the bash. On the other hand how do I start progs from bash? I heard something about creating links in home/username/bin/ to quickly exec them without having to jump dirs like crazy?
Or is there something of an equivalent to Alt+F2 and a program-name in the console? :)

===
edit: okay what happened to my typing?! *corrects some misspellings*

Lim45 03-09-2005 04:02 AM

Never used Suse 9.2, but if you're using KDE there should be a "File Manager-Super User Mode" icon buried somewhere in the menu. This will ask for your root password, and then bring up a root Konqueror window. Failing that, bring up the Run command and type "kdesu konqueror" (minus quotes) which will do essentially the same thing.

enemorales 03-09-2005 06:44 AM

I didn't understand very well. Let me see:

1) If you want to run a program with root privilegies, just use "su -" in a console and then run the program from there by writing the program name. For example, if you want firefox with root privilegies do

Code:

% su -
Password: (<-- Only you know what to type here, I guess)
# mozilla-firefox &

The "&" is only to make it run in background, independently of the xterminal. If you have more programs to run as root, just do it here and excecute "exit" to finish. Yet it may happen that the program you run cannot connect to the X server. In that case you have to use the "xhost" command before using "su -" to allow the program to run (probably are correct and technical names for everything I'm saying, but I don't know them :(). "xhost +" will allow anyone to use your display, while "xhost +localhost" should allow only the users in your computer.

2) You can put links in your ~/bin (~ is an abbrev. for /home/current_user) directory. They will run as long as ~/bin is in your PATH variable. But the same applies to any directory in that variable. What do you mean when you write "having to jump dirs like crazy"?

3) About bash and speed: the [TAB] key is your friend. It makes bash to "autocomplete" what you are writing in that moment (and/or give you the full list od possibilites, among others choices). I find it a lot faster than moving the mouse and clicking.

Another thing. Some people think it is not recommended to use GUI programs as root. There was the example of a system that crashed because some file manager (Nautilus, I believe) writes some information in any directory you visits (Thumbnails, maybe?). Anything went wrong when the user entered the /proc directory...

I hope this helps you. Good luck!


All times are GMT -5. The time now is 06:47 AM.