LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to Autologin as a root(Superuser) (https://www.linuxquestions.org/questions/linux-software-2/how-to-autologin-as-a-root-superuser-338592/)

m.harshavardhan 06-30-2005 12:26 AM

How to Autologin as a root(Superuser)
 
hi
i am using linux Fedora core 3.
is it possible to autologin as a root(super user)?
i am able to autologin as a non-root user .
now i want to autologin as a root.i know that some security problems will arise if we autologin as a root,but i will takecare.
when i start my PC it should not ask for me any user name and password ,it should automatically enter into system as a root ,it is called autologin for root.
i am able to autologin as a non-root(guest)user.but now i want root to be autologin.

thanks in advance
harsha

kencaz 06-30-2005 12:53 AM

I don't believe there is and hope there will not be a way in the future...

KC

mikedeatworld 06-30-2005 06:58 AM

Think about what you are asking, why you are asking this, which operating system does this, why those distros that login as root -- are unsecure...


How hard is it to login as root?

cs-cam 06-30-2005 07:09 AM

I'm pretty sure GDM will do this, it has auto-login for standard users I can't see why you couldn't log in as root the same way. Doing so would be ******* stupid but that's your call.

* - excuse the language, but it's true

mikedeatworld 06-30-2005 11:29 AM

Man, I feel bad for this guy, but really, how else can you respond to the question.

Please read this...

http://howtos.linux.com/guides/solrh...ap5sec32.shtml

doctorflange 06-30-2005 11:46 AM

Hehe, you know what's funny?

Windows will not only let an Administrator account not have a password, but also auto-log you in without a password if you're an Admin user.

Kdr Kane 06-30-2005 11:46 AM

You know what? This is a valid technical question. And I would also like to know the answer. I can't possibly fathom that it's impossible with all the awesome flexibility of Linux.

He said he understood the security implications. There wasn't any need to denegrate him or the question.

It is valid to make sure he is aware of the security concerns, but none of you really know what his requirements are.

DaWallace 06-30-2005 03:05 PM

it may not be impossible, but it is stupid and because of that, it has been made very difficult by those who make login managers. I know no way to make GDM do it without altering the source code, and recompiling, this is so idiots who don't fully understand what they're doing can't pull it off, there might be some hidden argument you could put in the configuration to get it to work this way but I doubt it.

whatever his requirements.. he should find another way.

zackarya 06-30-2005 04:00 PM

Well I have to say that I concur with the sentiment that this would be a
VERY BAD IDEA(and it might not be possible).

Having said that:

I would'nt think that you need to log in as root specifically, just someone with
higher privileges. Create a user who has the privileges that you need and use
that user.

Since you never said WHY you need to do this I don't know what your
trying to accomplish so that might not work for you.

Hope that helps.

Zack

jkirsher 07-21-2005 10:14 PM

I agree that it is a very bad idea to have the root autologin for any "production" system.

But there is a valid case for having a "test" system to have the ability to autologin with the root account.

Case in point, we have a test system which I do driver development. The system is not connected to any network and security is not an issue at all. If the system gets "comprimised" in any manner, we simply rebuild the system. It is much easier to do development under the root account since we have no need to security and the system is used only for development and testing. There are several test scripts which we have created to test out drivers and it would be of great use if we could modify the script to reboot the system into various kernels and run a validation script without having the user stand around waiting for the login prompt.

So back to the original question, even though we have clearly stated and discussed why this is a very bad idea, does anyone have a way for the root account to autologin?

jtmillard 07-22-2005 12:44 AM

How about this?
Instead of logging in as root, put yourself in the wheel group and set up
/etc/sudoers so you do not need a password.
Then write your test scripts to sudo the functions that require root access.
You get the password free access without munging the kernel or any other
standard software.
Doing this is still very dangerous but could make life easier on a driver developer.
I would never recommend this for a production system, but a driver development
system that can easily be recovered, heck why not, drivers will probably destroy
your system from time to time by themselves.

jkirsher 07-22-2005 06:23 PM

or better yet...

login in as root and execute the following:
passed -d
// deletes the need for a password for the root account

then edit /etc/inittab and add --autologin root to all the mingetty lines of the inittab, so your inittab would look something like this:

1:2345:respawn:/sbin/mingetty --autologin root tty1
2:2345:respawn:/sbin/mingetty --autologin root tty2
3:2345:respawn:/sbin/mingetty --autologin root tty3
4:2345:respawn:/sbin/mingetty --autologin root tty4
5:2345:respawn:/sbin/mingetty --autologin root tty5
6:2345:respawn:/sbin/mingetty --autologin root tty6

Reboot the system and your done. The system autologins into the root account.

RohanShrivastav 08-17-2005 04:10 AM

But before that you make sure that mingetty supports --autologin option. If not then apply patch.

chris.holman 09-06-2005 01:42 PM

Here another solution if you want to automatically log into KDE (or anything that uses a Display Manager to control logins) as root. Took me a while find it so I thought I'd write it up here. The solutions so obvious when you think about it.

I'm writing an automated test environment that simultaneously tests many networked devices. Each device does a network boot into a NFS mounted Linux OS . Many of the low level tests require root access and some require access to an X Windows display. There may be a more elegant solution, but this works for me.

I'm using RHEL AS3, but I'm sure this would work for other Linux distro's

As mentioned above, delete the root password. Login in as root and execute the following:
passed -d

You cannot use the GDM as it doesn't allow automatic root logins. Use KDM instead by editing /etc/X11/prefdm( or whatever is invoked at the end of your inittab) and set:

preferred = kdm # This makes kdm the default display manager

Now configure KDM by editing /etc/kde/kdm/kdmrc and set the following values:

[X-:0-Core]
# Enable automatic login on this display. USE WITH EXTREME CARE! <== Very true, and I wouldn't do this on any normal system.
# Default is false
AutoLoginEnable=true
# The user to log in automatically. NEVER specify root! <== Hmmm ,I'll just have to ignore this
AutoLoginUser=root

Reboot the system and your done. The system does an automatic login to KDE as the root user.

Regards,
Chris Holman
Awltux.com

mikedeatworld 09-06-2005 02:38 PM

Now, if you would have explained the reason for this, I bet the solution would have came much easier. Hope its going well....


All times are GMT -5. The time now is 01:55 AM.