LinuxQuestions.org
Visit Jeremy's Blog.
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 05-10-2006, 12:40 AM   #1
kajensen
Member
 
Registered: Aug 2003
Location: Santo Domingo, R.D.
Distribution: Ubuntu 14.04 LTS, Xubuntu 14.04 LTS
Posts: 90

Rep: Reputation: 15
Question Root Confusion




I understand that some functions can be executed in the GUI and others via the terminal and some in both.

What about signing into the terminal as root? Does this mean that if I then go to an app which I want to move to the trash with my mouse that I am still functioning as root user? Meaning, if I leave the terminal am I still logged on as root user? By "leave" I mean minimize, so that the task appears in queue in Nautilus.

When I boot I have the choice of entering my root password. Is this what I do when I want to function as root in the GNOME GUI??

Please clarify. Thanks for your help.
 
Old 05-10-2006, 01:26 AM   #2
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 60
you should never log into the GUI as the root user.. use root for as little as possible--its specifically for system administration ONLY! you could render your OS install useless if used improperly.

always log into your GUI as your normal user account.. when you need the root account for, say, installing a program, then open up a terminal and use 'su' to switch to root user temporarily, or 'sudo'.

if you open a terminal program while in your GUI, and switch user to root, it only applies to what you do in that window... if you minimize it (or dont) and switch to another task, you are still using your account that you initially logged into the GUI with. if you use 'su', make sure to use 'exit' when your done.

also note the prompt in terminal windows... '$' represents a normal user.. '#' represents su/root and is a warning to be careful.

hope this clears things up a little
 
Old 05-10-2006, 01:53 AM   #3
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 86
nadroj'a advice is good. Basically, you want to run as a regular using account all the time, except in limited, rare situations where you must be root (such as when you are installing new packages). With regards to your question, if you start a terminal session aka console session aka command line session, you should just use your regular user account. Running as root is a poor idea, as the chances of accidentally performing (unrecoverable) actions is pretty high - all it takes is to run an "rm" command from the wrong directory, and you could trash your entire system.

Overall, stay in regular user mode, and if you need to switch to root, use "su", and immediately switch back to your regular user as soon as you're done
 
Old 05-10-2006, 02:34 AM   #4
SweetLou
Member
 
Registered: Oct 2004
Distribution: Debian Testing
Posts: 171

Rep: Reputation: 30
Quote:
Originally Posted by nadroj
if you open a terminal program while in your GUI, and switch user to root, it only applies to what you do in that window... if you minimize it (or dont) and switch to another task, you are still using your account that you initially logged into the GUI with. if you use 'su', make sure to use 'exit' when your done.
Not quite true, but mostly true. You can as root open a program an use that as root outside of the terminal window. For example I often open Nautilus as root from the terminal when I know I will be moving, editing, etc files. I will find the file in Nautilus and then open gedit to edit it.
 
Old 05-10-2006, 02:57 AM   #5
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Quote:
Originally Posted by SweetLou
Not quite true, but mostly true. You can as root open a program an use that as root outside of the terminal window. For example I often open Nautilus as root from the terminal when I know I will be moving, editing, etc files. I will find the file in Nautilus and then open gedit to edit it.
I think nandroj was referring to an entirely CLI based session (thats my intepretation from his post). Obviously if you start GUI apps as root in your normal user login, they will always be running as root until you terminate them.
 
Old 05-10-2006, 07:54 AM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
In spite of the good advice to not log in to the GUI as root, note that you CAN do that....

To clarify several answers: any application--including the GUI dekstop--is opened by a user. Thus, when you log in to the GUI, you establish the user for the environment + anything opened later. When you become root in a terminal, it only applies to what you do in the terminal.

By opening an app as root (from the terminal), you can create a situation where you have GUI root privileges for that app--but still not for other things running on your desktop.

Bottom Line: Be careful!!!!
 
Old 05-10-2006, 12:59 PM   #7
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 60
Quote:
Originally Posted by SweetLou
Not quite true, but mostly true. You can as root open a program an use that as root outside of the terminal window. For example I often open Nautilus as root from the terminal when I know I will be moving, editing, etc files. I will find the file in Nautilus and then open gedit to edit it.
yes, of course you can use a GUI app (or any app!) as root launched through the terminal. ie 'vi' is a program.. just like Nautilus. i can use 'vi' as root and whatever i do in 'vi' will be done with the root user and it's privledges. same with nautilus. i can launch that app from the console as root, and i will then be using nautilus as root.. so i can go ahead and delete any file i want to and wont get messages saying i dont have rights to.
i didnt (or at least didnt meant to) imply that you cant launch GUI apps as root. sorry

Last edited by nadroj; 05-10-2006 at 01:00 PM.
 
Old 05-17-2006, 03:32 PM   #8
kajensen
Member
 
Registered: Aug 2003
Location: Santo Domingo, R.D.
Distribution: Ubuntu 14.04 LTS, Xubuntu 14.04 LTS
Posts: 90

Original Poster
Rep: Reputation: 15


If I am in a terminal session as root and then do something with my mouse in GNOME (e.g. delete a file), am I still functioning as root in my GNOME (GUI) session?

I read your posts carefully but I think there was confusion on this point.

And if I'm at a terminal as root how do I return to normal user? By typing exit??
 
Old 05-17-2006, 03:37 PM   #9
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
If you have logged in as a normal user, then start a terminal and switch to root, any mouse clicks you make are still done as a normal user. You exit the root session by entering "exit", "logout" or CTRL-D. If you are logged into a terminal as root and you start a gui app, then that app will have root privileges even if you are logged in as a normal user.
 
Old 05-17-2006, 10:33 PM   #10
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by reddazz
If you have logged in as a normal user, then start a terminal and switch to root, any mouse clicks you make are still done as a normal user. You exit the root session by entering "exit", "logout" or CTRL-D. If you are logged into a terminal as root and you start a gui app, then that app will have root privileges even if you are logged in as a normal user.
Maybe it will help to realize that--as far as your machine knows--you are two different people. Person #1 is logged in to the GUI with normal privileges, Person #2 has root privileges in the terminal. In fact, these two people could be doing things simultaneously---with no knowledge of what the other is doing. You could give the mouse to one and the keyboard to the other---and both be running things, changing files, whatever. What make it interesting is that #2 (root)--running in the terminal--could open a text editor which would appear on #1's GUI screen. As you can see, this quickly becomes convoluted.
Bottom line---keep your multiple personalities under control.....
 
  


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
g++ == confusion slantoflight Programming 4 02-20-2006 01:19 PM
a little confusion..... b0nd Linux - Newbie 1 02-17-2005 06:45 AM
root files: create as root:root or root:wheel? pcass Linux - Security 1 02-07-2004 04:14 PM
WM Confusion phoeniXflame Slackware 3 02-16-2003 05:19 AM
Some confusion about RH 7.3 psyklops Linux - Distributions 2 05-08-2002 03:08 PM

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

All times are GMT -5. The time now is 10:58 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