root log in changes desktop?

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
JustPlainFred

root log in changes desktop?

Post by JustPlainFred »

Hello All,
Question. When logging in as root,(at start up) trying to get Nvidia settings in a dual monitor (TV / PC ) setup to "stick." I noticed that when logged in as "root" the background screen changes and things in the "tool bar" are gone, or different. (from being logged in as user) Is this a normal occurrence? It seems that it's like having two different OS's, root and user.Thanks in advance... Regards Fred
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
rich_roast

Re: root log in changes desktop?

Post by rich_roast »

This is normal and your assessment is nearly accurate, except that instead of thinking of two "OS"s it's appropriate to think of two users. Root is an all powerful administrator user, distinct from your regular user, and who should only be doing maintenance tasks in maintenance mode (disconnected from the Internet, being careful...). Of course in real life these are both yourself on a single user desktop, but the distinction remains useful from a security perspective.

Whenever possible it is recommended to not log in as root. Try to use su and sudo as much as possible from your regular account. See

Code: Select all

man su
man sudo
for documentation on substituting user (i.e., substituting root for your regular user account so that real life you can obtain the necessary privileges to perform maintenance tasks). Using these commands grants you powers to perform maintenance tasks while allowing you to run other software, e.g. browsers with connections to the Internet, without a dangerously high level of privileges.
Fred

Re: root log in changes desktop?

Post by Fred »

JustPlainFred,

Where did you get an idea like that? You should almost never need to log in to an X session as root, (it has been years in my case). When you do you need to be disconnected from the internet, physically.

Not running an X session in root not only protects you but also all the rest of us.

Fred
User avatar
linuxviolin
Level 8
Level 8
Posts: 2081
Joined: Tue Feb 27, 2007 6:55 pm
Location: France

Re: root log in changes desktop?

Post by linuxviolin »

Fred wrote:JustPlainFred,

Where did you get an idea like that? You should almost never need to log in to an X session as root, (it has been years in my case). When you do you need to be disconnected from the internet, physically.

Not running an X session in root not only protects you but also all the rest of us.

Fred
I can only echo what Fred said. Copy 100 times: I NEVER LOG IN AS ROOT... :lol:

About the commands given by rich_roast, I don't know if many people know that for a more comfortable reading you can read man page(s) with Yelp in GNOME and Konqueror in KDE instead of a terminal :idea:
K.I.S.S. ===> "Keep It Simple, Stupid"
"Simplicity is the ultimate sophistication." (Leonardo da Vinci)
"Everything should be made as simple as possible, but no simpler." (Albert Einstein)
JustPlainFred

Re: root log in changes desktop?

Post by JustPlainFred »

Fred wrote:JustPlainFred,

Where did you get an idea like that? You should almost never need to log in to an X session as root, (it has been years in my case). When you do you need to be disconnected from the internet, physically.

Not running an X session in root not only protects you but also all the rest of us.

Fred
Fred,
Hello, first let me thank you all for responding. OK.... First I am new, and have no clue of what is considered to be "foolish or dangerous" when logging in as "root" i Just figured it was like running as an "administrator in Windows"... no big deal. I did so in hopes of getting my Nvidia settings to "stick" after re-starting and not reverting back .... Was reading through the"Newbie Posts" trying to find the answer to the problem, and came across the post "changing to root" ."What is a "X" session? Regards Fred
rich_roast

Re: root log in changes desktop?

Post by rich_roast »

Someone'll correct me if I'm wrong in thinking that running Windows as administrator (which, IIRC, was de facto back when I was running XP) is also dangerous and foolish. Running as root on a GNU/Linux distro is even worse, because root can just about do anything and linux commands are more powerful and will more often than not neglect to confirm potentially dangerous actions.

For example, when root, something as simple as

Code: Select all

rm -rf /asterisk
(replacing "asterisk" with that character) in the console will destroy your root file system, or get close to it. Running the same command as a regular user just gets you:

Code: Select all

rm: cannot remove `/dev/tty21': Permission denied
rm: cannot remove `/dev/tty22': Permission denied
rm: cannot remove `/dev/loop7': Permission denied
rm: cannot remove `/dev/ram6': Permission denied
rm: cannot remove `/dev/ram9': Permission denied
and hopefully you'll realise something's gone wrong before the command gets to your home directory, and hit ctrl+c. Even failing that, at least your entire filesystem won't have been irrevocably damaged.

This isn't just a problem because of the bug between the chair and the keyboard, it's a problem because of malicious threats from outside; malicious software and hackers can do relatively little without root privileges, but it's a severe compromise to be running as root when connected to the Internet. As an example, opening a malicious email attachment as a regular user will not allow it to install itself to your filesystem or make any cron jobs or anything like that, while opening it as root will effectively give it root privileges and let it do whatever it wants. Which is probably not equivalent to what you want.

Many users cite the dichotomy between superuser and regular user as (one of) the most important factors why Linux is considered safer and more robust than its counterpart from Redmond.

An 'X' session is where you log in to the GUI, as opposed to a terminal session where you log into the CLI. It is an especially bad idea to start an X session and run GUI apps as root. The problem resides in that there will be bugs/security holes in GUI software which, when it runs with root privileges, will have the power to compromise your system even though the same apps are quite safe to use as a regular user. GUI apps generally are not designed with running as root in mind. Certainly avoid running any software that connects to the Internet as root.

Bottom line: try to only use sudo and su from your regular account. I can't think of any reason at the moment to be logged in as root, barring dropping to the CLI in recovery mode if something's gone badly wrong.

When debugging a problem like the one you've encountered, it is generally better to take small, patient, systematic steps than to try something like logging in as root to see if it will make a configuration "stick". If you're using the third party nVidia drivers (i.e., those from nVidia that you'd get through envyNG or the "Hardware Drivers" app in the Admin menu), then nVidia also offer support and might be the best place to go; certainly they would never recommend logging into an X session as root (at least I hope they wouldn't!)

In any event, could you cite the url of the original thread? Thanks.
Holy Smoke

Re: root log in changes desktop?

Post by Holy Smoke »

Hi! I had a problem crash and went to the recovery mode boot. It started to repair the system but eventually stopped at a root log in. When I entered my normal log in and password it was rejected. How do I get a different login and password than the one I have always used? Can I change it?
Help New to Mint!
[/b]
JustPlainFred

Re: root log in changes desktop?

Post by JustPlainFred »

rich_roast wrote:Someone'll correct me if I'm wrong in thinking that running Windows as administrator (which, IIRC, was de facto back when I was running XP) is also dangerous and foolish. Running as root on a GNU/Linux distro is even worse, because root can just about do anything and linux commands are more powerful and will more often than not neglect to confirm potentially dangerous actions.

For example, when root, something as simple as

Code: Select all

rm -rf /asterisk
(replacing "asterisk" with that character) in the console will destroy your root file system, or get close to it. Running the same command as a regular user just gets you:

Code: Select all

rm: cannot remove `/dev/tty21': Permission denied
rm: cannot remove `/dev/tty22': Permission denied
rm: cannot remove `/dev/loop7': Permission denied
rm: cannot remove `/dev/ram6': Permission denied
rm: cannot remove `/dev/ram9': Permission denied
and hopefully you'll realise something's gone wrong before the command gets to your home directory, and hit ctrl+c. Even failing that, at least your entire filesystem won't have been irrevocably damaged.

This isn't just a problem because of the bug between the chair and the keyboard, it's a problem because of malicious threats from outside; malicious software and hackers can do relatively little without root privileges, but it's a severe compromise to be running as root when connected to the Internet. As an example, opening a malicious email attachment as a regular user will not allow it to install itself to your filesystem or make any cron jobs or anything like that, while opening it as root will effectively give it root privileges and let it do whatever it wants. Which is probably not equivalent to what you want.

Many users cite the dichotomy between superuser and regular user as (one of) the most important factors why Linux is considered safer and more robust than its counterpart from Redmond.

An 'X' session is where you log in to the GUI, as opposed to a terminal session where you log into the CLI. It is an especially bad idea to start an X session and run GUI apps as root. The problem resides in that there will be bugs/security holes in GUI software which, when it runs with root privileges, will have the power to compromise your system even though the same apps are quite safe to use as a regular user. GUI apps generally are not designed with running as root in mind. Certainly avoid running any software that connects to the Internet as root.

Bottom line: try to only use sudo and su from your regular account. I can't think of any reason at the moment to be logged in as root, barring dropping to the CLI in recovery mode if something's gone badly wrong.

When debugging a problem like the one you've encountered, it is generally better to take small, patient, systematic steps than to try something like logging in as root to see if it will make a configuration "stick". If you're using the third party nVidia drivers (i.e., those from nVidia that you'd get through envyNG or the "Hardware Drivers" app in the Admin menu), then nVidia also offer support and might be the best place to go; certainly they would never recommend logging into an X session as root (at least I hope they wouldn't!)

In any event, could you cite the url of the original thread? Thanks.
rich_roast,
Hello and thank you for your explanation, i will do as you have suggested and never run as root unless i have to. As far as the original thread... This is the best that i can offer at this point, as of yet i don't know how to do a screen shot, or insert a url . If you search "hdmi nvida" it's a post by "lantesh" Mon April 12 2010 Re: Home Theatre Media center comparison Thanks again Regards Fred
rich_roast

Re: root log in changes desktop?

Post by rich_roast »

Holy Smoke wrote:Hi! I had a problem crash and went to the recovery mode boot. It started to repair the system but eventually stopped at a root log in. When I entered my normal log in and password it was rejected. How do I get a different login and password than the one I have always used? Can I change it?
Help New to Mint!
Welcome to Mint and the forum, Holy Smoke. Right off the bat, although you may have heard from other forums that "it is always better to continue an existing thread than start a new one", that is not really the case on a tech support board like this one unless your problem is exactly the same as the OP's, or directly related. You should really start a new thread. Also, it is advisable not to use unusual font sizes and write all in bold; it might irritate some readers which means you're less likely to get a reply. Although your problem is frustrating, try to keep it sane.

As to your actual problem, AFAIK recovery mode doesn't automatically perform any fixes (does it? Someone will correct me if I'm wrong). At the invitation to log in as root and drop to the CLI, all that should be required is your password, IIRC. If you do need to enter a username then that username should be "root". However, it might be better, since you are new, that you begin a new thread, describe the events leading up to your needing to boot into recovery mode, and seek advice, since I am uncertain as to what you plan to do having logged in as root. There will be no GUI, and precious little in the way of help, so if you're inexperienced with Mint/Linux in general I think you're going to need more help as to what to do having successfully logged in. Refer to the forum rules for guidance as to what to put in your post to help others help you.

@JustPlainFred, I'll search for that thread and contribute there, if I have anything, since it's going to get off the subject of this thread. To put in a url, assuming you're using a graphical browser it's a question of clicking on the URL button just above the text box. Hover your mouse over the button for full instructions. I prefer just to type in the code:

Code: Select all

[url="whatever.com"]Whatever[/url]
For images, the Img button, or

Code: Select all

[img]http://example.photohost.com/image.png[/img]
But I'd use that sparingly. Cheers.

[Edit:]OK, I'm back:
Lantesh wrote:Quake3DeathGod you can change your resolution with nvidia-settings. Just make sure you run it as root so your changes apply
OK, what Lantesh meant was run nvidia-settings as root, just once, to set up the driver and that's it, I don't have the nVidia drivers myself, so I forget whether or not nvidia-settings is able to run while X is running, or if you have to switch to a tty and stop gdm, but either way Lantesh meant that you should ultimately do:

Code: Select all

sudo nvidia-settings
and type your password if required. The reason being that nvidia-settings need to write to a configuration file at /etc/X11/Xorg.conf, which is owned by root, and therefore not writeable by your regular user. Once the program has run, though, and the changes made, they should be permanent though. In your original description, it sounds as though they are not, hence your experiments to try to rectify that.

I think your best course of action, should you continue to experience problems, would be to begin a new thread describing your symptoms. Best, RR.
User avatar
Daveleh
Level 3
Level 3
Posts: 100
Joined: Wed Feb 24, 2010 3:15 pm
Location: Swindon, UK

Re: root log in changes desktop?

Post by Daveleh »

rich_roast wrote:Someone'll correct me if I'm wrong in thinking that running Windows as administrator (which, IIRC, was de facto back when I was running XP) is also dangerous and foolish.
Yes, that's true. Unfortunately when you install/start windows for the first time then the first user account created is created with full admin privileges. Then it's up to the individual user to create a second, limited privilege account. This is how the majority of windows home users operate, without creating a second, main, user with limited privileges. This is one of the reasons why so many windows pc's are so easily infected.

Regards
Daveleh
Cornwall, UK

Go on - walk1000miles.co.uk

Mint 19.3 xfce fully updated on an Acer Aspire 5349 laptop with 4Gb memory and 750Gb HDD
Fred

Re: root log in changes desktop?

Post by Fred »

I am certainly not a Windows expert but I also understand that even the later versions of a lot of Windows programs require root/admin. privileges to run correctly. This makes it even harder for Windows users to do the "right thing" even if they know better.

Fred
FedoraRefugee

Re: root log in changes desktop?

Post by FedoraRefugee »

Fred wrote:I am certainly not a Windows expert but I also understand that even the later versions of a lot of Windows programs require root/admin. privileges to run correctly. This makes it even harder for Windows users to do the "right thing" even if they know better.

Fred
I am not an expert in this either but the Windows UAC is a bit different than the Unix root/user system. UAC just escalates the privileges much like Sudo.

I have not had any problems with Vista or Windows 7 in this regard, but I do not do much playing in Windows. I use only a few programs and most of those are open source. I do all my experimenting in Linux, so that might be a factor. But as far as I can tell Windows is now adequately secure. I suppose at the end of the day common sense is the ultimate safeguard in any OS though.
Fred

Re: root log in changes desktop?

Post by Fred »

FedoraRefugee,

I am sure you are much more knowledgeable about Windows than I am. I have never even seen Vista/Win7 running. lol Even with XP, I never used it on a day-to-day bases. Though I have fixed and installed it for others about a kzillion times. :-)

I will just have to take your word that vast improvements have been made. lol

Fred
User avatar
linuxviolin
Level 8
Level 8
Posts: 2081
Joined: Tue Feb 27, 2007 6:55 pm
Location: France

Re: root log in changes desktop?

Post by linuxviolin »

Daveleh wrote:Unfortunately when you install/start windows for the first time then the first user account created is created with full admin privileges. Then it's up to the individual user to create a second, limited privilege account. This is how the majority of windows home users operate, without creating a second, main, user with limited privileges. This is one of the reasons why so many windows pc's are so easily infected.
Nope. This was with the old Windows, e.g. XP, not with Win7. See the FedoraRefugee post.
FedoraRefugee wrote: the Windows UAC is a bit different than the Unix root/user system. UAC just escalates the privileges much like Sudo. (...) But as far as I can tell Windows is now adequately secure.
Yes. The time where the first user has all rights is over in Windows. You have now a kind of sudo... Btw, at first this has annoyed a number of users who were not used to being asked permission to make/run this or that. Some seeking to turn it off, as some in Linux (see certain posts even in these forums), to be permanently connected in root... :)
K.I.S.S. ===> "Keep It Simple, Stupid"
"Simplicity is the ultimate sophistication." (Leonardo da Vinci)
"Everything should be made as simple as possible, but no simpler." (Albert Einstein)
deleted

Re: root log in changes desktop?

Post by deleted »

Since this thread has diverged anyway... I'll add an anecdote from my tour of duty with a German (non-SUSE) distro.
They told me that in German (I don't speak or read it), The name (Using English pronunciation ) "Ruth" is pronounced like "Root", so in their office, they didn't let folks run as "Ruth";)
I think I said "I'm a jelly donut" and we found that humor was the great unifying language;)
-Hinto
rich_roast

The root of all evil

Post by rich_roast »

In a similarly diverging vein, for years I've held a nagging suspicion that calling the "superuser" "root" is a recipe for trouble, since we also have root directory(ies), root's own directory, and so on. Yet saying "superuser" (derived from the command su, presumably, on the mistaken notion that it stands for that (it doesn't - the command is substitute user)) sounds goofy like it's out of a comic book. 'Administrator' won't quite do, either, since I think I'm right in saying that users within the wheel group count as admins. So I guess we're stuck with "root"... :?
Locked

Return to “Beginner Questions”