Why does the root account not prompt for a password after a screen lock?
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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?
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!
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
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"
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 ).
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.
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.
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.
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
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!
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.