Mingetty autologin patch
A student asked me how to autologin on a linux terminal. 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 mingetty that allows autologin... but it's for an older version (0.9.4) and I can't even find it.
After a while, I check the SRPM from RH9... and it has the patch in the source tarball, but doesn't apply it. No wonder, since it doesn't work.
So, I patched the patch, and here it is: a autologin patch for mingetty 1.0.1... I have so clear in my mind why I don't program in C :-) (although it was rather easy).
The patch
I even have a patched SPEC file (no biggie there), and even src.rpms that should work on any Red Hat like thing.
After you install the patched mingetty, you can put a line like this in your /etc/inittab
1:2345:respawn:/sbin/mingetty tty1 --autologin=ralsina
And a session for user ralsina will open in tty1. You can't even quite logout, since it logs you back in.
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).
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 :-)
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.
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.
this is really interesting viewpoint on the subject i might add
Well, the write-up is truly the freshest on this laudable topic.