Skip to main content

Ralsina.Me — Roberto Alsina's website

Mingetty autologin patch

A stu­dent asked me how to au­tolo­gin on a lin­ux ter­mi­nal. I thought... that can't be hard... I just don't know how it's done.

So, I googled, and there's a patch for minget­ty that al­lows au­tolo­gin... but it's for an old­er ver­sion (0.9.4) and I can't even find it.

Af­ter a while, I check the SRPM from RH9... and it has the patch in the source tar­ball, but does­n't ap­ply it. No won­der, since it does­n't work.

So, I patched the patch, and here it is: a au­tolo­gin patch for minget­ty 1.0.1... I have so clear in my mind why I don't pro­gram in C :-) (although it was rather easy).

The patch

I even have a patched SPEC file (no big­gie there), and even sr­c.rpms that should work on any Red Hat like thing.

Af­ter you in­stall the patched minget­ty, you can put a line like this in your /etc/init­tab

1:2345:respawn:/sbin/mingetty tty1 --autologin=ralsina

And a ses­sion for us­er ralsi­na will open in tty1. You can't even quite lo­gout, since it logs you back in.

Jonas / 2006-04-03 06:53:

Why do you want to mess with a getty if you don't want to log in?



I have a 'su' that starts X11/KDE as me in my rc.local (on my home computer).

Roberto Alsina / 2006-04-03 06:54:

This is for a text login. For a X session, it's actually simpler, and I have already done it. For example here:



http://www.pycs.net/lateral/stories/4.html



Surprisingly, a terminal session is quite a bit harder.



As for why... well, it's what my ex-student asked me. What was I gonna answer? "You can't do that", that's not true. "You shouldn't do that", is more like it, but maybe he has a reason :-)

Georg Bauer / 2006-04-03 06:54:

Why don't you just start a shell hooked up to another tty? For example the "open" command does this quite nicely. I usually use it to start top on one console as a nonprivileged user so others can easily look at what is running on that machine and taking up resources without giving them logins.

Roberto Alsina / 2006-04-03 06:56:

Because I never heard of it? ;-)



In fact, I don't have it, but I have a openvt thingie that may do the same thing.

phone number lookup / 2011-12-03 22:41:

this is really interesting viewpoint on the subject i might add

employment background check / 2011-12-27 23:34:


Well, the write-up is truly the freshest on this laudable topic.