PDA

View Full Version : Autologin on text console



bachtiar
2nd April 2006, 10:08 PM
Hi,

How can I make a system start in text mode, with only one console, and run bash as root without login prompt?

I want to make this as minimal as possible, e.g. even without mingetty.

Thanks a lot!

pparks1
2nd April 2006, 10:47 PM
I simply have to ask.....

Why would you ever want a linux box to auto logon as root?

bachtiar
2nd April 2006, 10:57 PM
When you use a dishwasher, you don't expect to enter a username and password, do you?

Jman
3rd April 2006, 03:20 AM
I believe runlevel 1, single user, doesn't prompt for a password. It doesn't start many services, however. Maybe duplicate what it does in the unused level 4, plus whatever you need.

pparks1
3rd April 2006, 07:57 PM
When you logon as root, you have complete and total control over the box. You can do anything including erasing absolutely everything and rendering the system completely useless. It just doesn't seem like a good idea to auto logon as root. Maybe a standard user account, but certainly not root.

bachtiar
3rd April 2006, 09:18 PM
When you logon as root, you have complete and total control over the box. You can do anything including erasing absolutely everything and rendering the system completely useless. It just doesn't seem like a good idea to auto logon as root. Maybe a standard user account, but certainly not root.

Please, I know that.

I want to build a special machine that will just display a text menu when powered on, and run a program based on user's choice. I do not want a user to type any password to get there. It's like a microwave - you don't want to type a password to use it.

schneis
27th May 2006, 08:40 AM
I'm also looking for a good solution for auto logging in on a text console. Security issues aside for the moment.

The best I've been able to come up with is to edit /etc/inittab and change the line that reads:
1:2345:respawn:/sbin/mingetty tty1

to something like:
1:2345:respawn:/some/path/mycommand

I've used a simple shell-script as /some/path/mycommand to setup and run some programs. The problem is that the tty doesn't seem to be correctly initialized for full interactive use.

pete_1967
27th May 2006, 11:14 AM
Please, I know that.It's like a microwave - you don't want to type a password to use it.

But you still have to ensure that the door is properly closed before you can turn it on ;)

schneis
28th May 2006, 04:19 AM
Here's a getty replacement which also seems to accomplish the auto-login:

http://www.pell.portland.or.us/~orc/Code/plugh/

I haven't really checked it out, but thought I'd throw it up here in case anyone else is still looking.

kendallgreen
6th June 2006, 09:03 PM
I have set up autologin on a simple server, FC3, for user auto, 1:2345:respawn:/sbin/mingetty --autologin auto tty1 I removed auto's password with passwd -d auto. However, when I ssh to auto home page, it asks for auto's password. When I hit enter, it says the password is wrong. When the server comes up with no keyboard or mouse, autologin works as advertized. I can ssh to root and other users home pages. What is wrong?

pparks1
6th June 2006, 10:26 PM
Let me restate my opinion on this: I WOULD NEVER SUGGEST DOING WHAT I AM WRITING HERE

Modify /etc/inittab

set


id:3:initdefault

At the bottom, find the # Run gettys in standard run levels. Modify the first as shown below and comment out the rest.


1:2345:respawn:/bin/bash
#2:2345:respawn:/sbin/mingetty tty2
#3:2345:respawn:/sbin/mingetty tty3
#4:2345:respawn:/sbin/mingetty tty4
#5:2345:respawn:/sbin/mingetty tty5
#6:2345:respawn:/sbin/mingetty tty6

reboot and you are auto logged on as root and sitting at the shell. set a script in root's profile to auto launch after logon and you should be all set.


And this is nothing like using a dishwasher or a microwave. It's more like having a gun and checking to see if the safety is on by pointing it at your face and pulling the trigger to see if you die :)

kendallgreen
7th June 2006, 12:47 PM
I don't want to login as root, I want to login to a restricted user home page on a simple server with no keyboard or monitor. autologin works on the server after a short boot delay

kam_ram
7th November 2007, 07:22 AM
hey everyone, i am also wanting to auto login on a machine running FC5...i tried pparks1 suggestion...it didnt do wat i wanted it to....but now my system doesnt boot at all...any idea how i can reverse these changes?...thanks guys..

kam_ram
8th November 2007, 06:16 AM
ok i got the non-booting system back up and running using the linux rescue utility on CD...but the auto-login issue still remains...

gintos
10th December 2008, 01:24 PM
edit /etc/pam.d/login file

Farmar
12th November 2009, 09:38 AM
for autologin in textmode on fedora 11 take a look over here :

http://forums.fedoraforum.org/showthread.php?p=1289085&posted=1#post1289085

giulix
12th November 2009, 09:41 AM
It's like a microwave - you don't want to type a password to use it.
Not to use it, but if you want to put your hand in it while it is functioning, you'll have some tinkering to do... :D