LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-07-2005, 09:00 PM   #1
artificialGekko
Member
 
Registered: Mar 2005
Posts: 77

Rep: Reputation: 15
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?
 
Old 03-07-2005, 09:36 PM   #2
FrayAdjacent
Member
 
Registered: Feb 2005
Location: Austin, TX
Distribution: Fedora Core 3
Posts: 34

Rep: Reputation: 15
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.
 
Old 03-07-2005, 09:47 PM   #3
artificialGekko
Member
 
Registered: Mar 2005
Posts: 77

Original Poster
Rep: Reputation: 15
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
 
Old 03-07-2005, 09:49 PM   #4
FrayAdjacent
Member
 
Registered: Feb 2005
Location: Austin, TX
Distribution: Fedora Core 3
Posts: 34

Rep: Reputation: 15
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.
 
Old 03-08-2005, 12:22 AM   #5
El Basto
Member
 
Registered: Jun 2004
Location: Thousand Oaks, CA
Distribution: Suse 9.2, Slackware
Posts: 76

Rep: Reputation: 15
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?
 
Old 03-08-2005, 03:17 AM   #6
OldPlanet
LQ Newbie
 
Registered: Feb 2005
Distribution: Arch Linux
Posts: 13

Rep: Reputation: 0
If you want to run your GUI filemanageras root, just run SU in a terminal and then start the filemanager from the terminal.
 
Old 03-08-2005, 04:56 AM   #7
enemorales
Member
 
Registered: Jul 2004
Location: Santiago, Chile
Distribution: Ubuntu
Posts: 410

Rep: Reputation: 31
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...
 
Old 03-08-2005, 09:24 PM   #8
artificialGekko
Member
 
Registered: Mar 2005
Posts: 77

Original Poster
Rep: Reputation: 15
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*

Last edited by artificialGekko; 03-08-2005 at 10:27 PM.
 
Old 03-09-2005, 05:02 AM   #9
Lim45
Member
 
Registered: Apr 2003
Location: Northern England
Distribution: Debian Wheezy 64-bit
Posts: 128

Rep: Reputation: 15
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.
 
Old 03-09-2005, 07:44 AM   #10
enemorales
Member
 
Registered: Jul 2004
Location: Santiago, Chile
Distribution: Ubuntu
Posts: 410

Rep: Reputation: 31
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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
switching between user and root without logging out redhat_marsi Linux - Newbie 7 06-13-2005 11:38 AM
Clone root to = or > partition on diff type hd quickly! suguru Linux - Software 13 08-09-2004 01:53 PM
Switching from Gnome to KDE on all users from root cowboy45 Linux - Software 3 03-16-2004 02:36 PM
switching to root Stan the caddy Linux - Newbie 9 01-17-2004 03:54 AM
Switching between root and user PapaNoHair Slackware 14 07-28-2003 01:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration