LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 06-23-2009, 10:59 PM   #1
sd9
Member
 
Registered: Apr 2009
Posts: 53

Rep: Reputation: 15
Why does the root account not prompt for a password after a screen lock?


I'd just like to know why...and if there's a possible way of locking the screen so that it prompts for a password.

I've already been thru this thread: http://www.linuxforums.org/forum/red...reen-root.html
but it seems nobody there knows.

Was there a reason that the programmers of Linux omitted the password prompt?
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 06-24-2009, 03:33 AM   #2
jsteel
Member
 
Registered: Mar 2007
Location: England
Distribution: Arch
Posts: 392

Rep: Reputation: 34
What distribution and desktop environment/window manager are you using? What method are you using to lock the screen?
 
Old 06-24-2009, 04:28 AM   #3
rikxik
Member
 
Registered: Dec 2007
Posts: 88

Rep: Reputation: 19
If you are using Gnome, it has an panel applet to switch off monitor and lock the screen. You need to right click on the gnome-panel, choose "Add to panel" and select the applet.
 
Old 06-24-2009, 06:20 AM   #4
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
You are going to have to be more concrete and give us details. The thread you pointed in the first is something you really shouldn't be looking at, and you can consider yourself lucky that you didn't find your "answer" there, really. Overall if you value security.

What are you exactly trying to do? Please, describe, there are thousands of ways to lock the screen. What kind of trigger do you want? Like in iddle time/screensaver? A button? A key combo? A command? In X? Pure text console?
 
Old 06-24-2009, 07:22 AM   #5
sd9
Member
 
Registered: Apr 2009
Posts: 53

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by i92guboj View Post
You are going to have to be more concrete and give us details. The thread you pointed in the first is something you really shouldn't be looking at, and you can consider yourself lucky that you didn't find your "answer" there, really. Overall if you value security.

What are you exactly trying to do? Please, describe, there are thousands of ways to lock the screen. What kind of trigger do you want? Like in iddle time/screensaver? A button? A key combo? A command? In X? Pure text console?
Am using Fedora 8. I logged in as root (which I don't generally do. Just wanted to check out something) and had to leave my desk for a while. I used the Ctrl+Alt+L key combination to lock the screen. When I returned and pressed enter, the account opened without prompting for a password.
The password is prompted for on a normal account...I'm surprised that it doesn't happen on a root account!
 
Old 06-24-2009, 08:34 AM   #6
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
I guess that that key combo invokes the default screensaver under gnome or something like that.

You can surely configure the gnome screensaver (whatever that is these days) to do what you want. In the old days it used to be xscreensaver, I am not sure what it is now, but following the convention i'd start looking for gnome-screensaver or similar. There must be a configure dialog somewhere to configure it, and there you should be able to find an option to ask for a password when turning off the screensaver. But this are all guesses, gnome is not know for its configurability after all
 
Old 06-24-2009, 10:59 PM   #7
sd9
Member
 
Registered: Apr 2009
Posts: 53

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by i92guboj View Post
I guess that that key combo invokes the default screensaver under gnome or something like that.

You can surely configure the gnome screensaver (whatever that is these days) to do what you want. In the old days it used to be xscreensaver, I am not sure what it is now, but following the convention i'd start looking for gnome-screensaver or similar. There must be a configure dialog somewhere to configure it, and there you should be able to find an option to ask for a password when turning off the screensaver. But this are all guesses, gnome is not know for its configurability after all
Okay, so it's part of the screensaver....
I went to the screensaver options and the "Lock screen when screensaver is active" option is disabled.
There is also a message in bold which says "Warning: the screen will not be locked for the root user"

They've done it on purpose: https://bugzilla.redhat.com/show_bug.cgi?id=208229
Which makes me wonder why.
 
Old 06-25-2009, 01:01 AM   #8
rikxik
Member
 
Registered: Dec 2007
Posts: 88

Rep: Reputation: 19
Thats awesome! One would think the locking will be even more wanted when you are "god" (aka root)
 
Old 06-25-2009, 05:06 AM   #9
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
It's not that awesome.

When you are logged in as root you are not supposed to go away. My guess is that that measure is yet another way to enforce this mentality that you really shouldn't be logged as root all the day long.

Your options are as I see it:
  • use another screen saver or an alternate program to lock the screen
  • patch gnome-screensaver, it shouldn't be so difficult to remove the root check (once you find it, that's it)

Besides the obvious option which you already know (so I am not going to repeat it ).

Last edited by i92guboj; 06-25-2009 at 05:08 AM.
 
Old 06-25-2009, 05:38 AM   #10
sd9
Member
 
Registered: Apr 2009
Posts: 53

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by i92guboj View Post
It's not that awesome.
  • patch gnome-screensaver, it shouldn't be so difficult to remove the root check (once you find it, that's it)
Errr....we can patch it? I thought if we wanted to tweak anything on Linux, we'd have to download the entire Linux code, make changes where we want to, compile the entire thing and then install it as an operating system.
I'm completely new to Linux, so I'm surprised at what you mentioned. I won't take this discussion too far...but I am intrigued and this is something I wanted to know for a long time - how do developers make small changes to Linux...I guess that's what makes it popular among them.
 
Old 06-25-2009, 05:55 AM   #11
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Your operating system isn't one monolithic piece of software; it's made up of hundreds or thousands of different pieces of software.

To break it down very simply, there are two principal types of software:

1. The kernel (Linux).
2. The rest.

Linux is just a kernel (the piece of software which manages the interactions between you, programs and the hardware in your computer). The majority of the rest of the programs in your Linux-based operating system are probably from GNU, which is why the Free Software Foundation (and the GNU Project!) think all Linux-based operating systems should be called GNU/Linux, since it's a symbiotic relationship. There's also independent bits of software developed by people in their spare time, independent companies etc. which make up some of the other utilities you'll use on a daily basis (think Firefox, for example).

Thus, if there's a part of the operating system's functionality that you don't like, or think you can improve, you can just download the source code for that particular piece, amend it as you see fit, and then install it instead of the one you got bundled with the operating system. Whilst this is a wildly simplified overview, it's probably a good start.

As for why developers like Linux, it's probably got more to do with the fact that you *can* download the source, edit it as you see fit, and then make those changes available to others, if you think they'll improve things. Using Windows as an example, if you don't like the way something works that is pretty fundamental to the operating system, and you have the ability to fix it, you still have to wait for Microsoft to make those changes.

One way to make small changes in functionality to a program is to edit the source code to include your new functionality, and then generate a new file (called a patch) which shows the difference between the original source code and your new, improved version. Thus, using a program called patch, people can add the changes you made to their copies of the source code, which means they can now have your new functionality. This is generally all stored in a central source code repository for development so that when people want the most recent version of a piece of software, they can go to that repository and download it.

Last edited by pwc101; 06-25-2009 at 05:56 AM.
 
Old 06-25-2009, 06:00 AM   #12
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by sd9 View Post
Errr....we can patch it? I thought if we wanted to tweak anything on Linux, we'd have to download the entire Linux code, make changes where we want to, compile the entire thing and then install it as an operating system.
You would need to fetch the source code for gnome-screensaver (I am assuming that the check is there, and not in some library), change the source code to eliminate that check, then compile it and install it in place of the gnome-screensaver that your distribution offers.

I guess that when I said "patch" you thought of binary patches like the ones that some people use in windows to do *ahem* fancy things with binary applications that are already installed.

That would be possible just like it is in windows. No mystery, but to make such a patch you need to disassemble and go tracing the instructions one by one, then change some hex bytes to revert or ignore the critical check. That would be an unnecessary amount of pain considering that the sources are available, wouldn't it? We have no need for binary cracks. We change the sources and recompile.
 
Old 06-25-2009, 11:11 PM   #13
rikxik
Member
 
Registered: Dec 2007
Posts: 88

Rep: Reputation: 19
Quote:
Originally Posted by i92guboj View Post
It's not that awesome.

When you are logged in as root you are not supposed to go away. My guess is that that measure is yet another way to enforce this mentality that you really shouldn't be logged as root all the day long.
Personally it doesn't make sense - if I'm running task(s) expected to run for a considerable time, am I suppose to babysit the console? I know options like nohup etc. but no way to lock the console certainly is enforcing with excessive force
 
Old 06-29-2009, 03:47 AM   #14
sd9
Member
 
Registered: Apr 2009
Posts: 53

Original Poster
Rep: Reputation: 15
Thanks a lot pwc101 and i92guboj!!! Had a look at the kernel archives. Saw a patch there...the code was a bit weird, but I guess it's the other supporting softwares code which I'll have to look into.

Anyway, it's good to know this info for a start. Will definitely go further into it when I have the resources to do so Thanks a lot!
 
Old 08-30-2017, 12:19 AM   #15
ajob
LQ Newbie
 
Registered: Aug 2017
Posts: 1

Rep: Reputation: Disabled
Lock root screen with password workaround

Too late to reply but might help someone else.
As it says "warning: the screen will not be locked for the root user", you would not be able to lock it unless you install some non standard repos. The work around is to switch user if you have an additional user. When you try to log back into root, if you had a password, it will ask the password. You will not loose running processes but might be interrupted though.
 
  


Reply



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
Can unlock screen with root password in my user account - want to change this sm1 Linux - Newbie 2 07-24-2005 05:54 AM
lock root account after 3 login attempts - RHEL AS 3 jrparker2005 Red Hat 1 05-17-2005 12:43 PM
Root Password Prompt Greyed Out !!! lionking_x Linux - Software 2 04-08-2004 10:05 AM
no password prompt after root login taboo Linux - General 1 12-22-2003 01:01 PM
Lock screen password!!! bear7 Linux - Newbie 4 11-12-2003 07:02 PM

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

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