LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Q) How to automatically login? (http://www.linuxquestions.org/questions/linux-general-1/q-how-to-automatically-login-66824/)

jattreadwell 06-20-2003 08:51 AM

Q) How to automatically login?
 
I am wanting to setup my system where it will not prompt for a login name or password. Any help or links will be greatly appreciated.

TIA

trickykid 06-20-2003 09:36 AM

A search on "automatic login" pulled close to 50 threads just alone on this site.

http://www.linuxquestions.org/questi...der=descending

Check some of those out as I know this has been discussed numerous times in the past.

jattreadwell 06-20-2003 09:39 AM

Thanks trickykid, I was searching, but apparently not using the correct phrase. THANKS for helping a newbie!

jattreadwell 06-20-2003 10:50 AM

Well, after reading the various posts, I don't think I am any closer. It is general thought that you do not want to do this, but this is the route I have decided to take. I would like to be able to turn my system on and have it boot with no user interaction to a command prompt. I would like this user to be logged in as root. Any suggestions? Thanks again everyone...

fancypiper 06-20-2003 10:56 AM

I think Windows 98 works that way.

trickykid 06-20-2003 11:05 AM

Quote:

Originally posted by jattreadwell
Well, after reading the various posts, I don't think I am any closer. It is general thought that you do not want to do this, but this is the route I have decided to take. I would like to be able to turn my system on and have it boot with no user interaction to a command prompt. I would like this user to be logged in as root. Any suggestions? Thanks again everyone...
Well I personally would want to ask why you need a machine to just boot directly to a command prompt as root? This is not a good idea and not good security measures to have on your machine.
I personally have never setup something like this as I most likely would never do this myself. Let us know!

jattreadwell 06-20-2003 11:18 AM

trickykid,

This is an embedded system that is static so it doesn't matter if they hose it, just reboot and it's fixed. There are many unknown users so passwords won't work. Thanks for your help AGAIN!!!

jattreadwell 06-20-2003 01:01 PM

Figured it out. Create a file named autologin.c add this to the file:
int main () { execlp ("login", "login", "-f", "root", 0); }

Now gcc -o autologin autologin.c
Now cp autologin /sbin
Now edit your etc/inittab file, look for the line that looks like this:
1:2345:respawn:/sbin/getty 38400 tty1 and change to
1:2345:respawn:/sbin/getty -n -l /sbin/autologin 38400 tty1

This should now autologin as root. Your inittab file may be slightly different, but you should be able to figure it out from the example. Hope this helps someone else out there!

Thanks all...


All times are GMT -5. The time now is 12:22 AM.