autologin without GUI
Ok, here's what I'm doing...
I have Debian 3.10 installed on a kiosk machine. I want it to automatically log in as a user so that if there's a power outage, wo don't have to walk around with a keyboard unlocking each kiosk and logging in. We are NOT using GDM, KDM, etc. If we were, I wouldn't be asking this. We are using XFree86 and fvwm for the window manager. That's it. The only other software is firefox and whatever is installed as a bare minimum (ssh, etc...). Thanks in advance! |
Here's some notes from an article at http://www.linuxgazette.com/issue72/chung.html
Create a file named autologinfred.c and type in this short C program: Code:
int main() { gcc -o autologinfred autologinfred.c chmod 755 autologinfred cp autologinfred /usr/local/sbin/ Edit /etc/inittab and change the line beginning with "1:2345" so that it reads as follows: 1:2345:respawn:/sbin/getty -n -l /usr/local/sbin/autologinfred 38400 tty1 On some GNU/Linux distributions (like RedHat) /sbin/agetty must be used instead. 1:2345:respawn:/sbin/agetty -n -l /usr/local/sbin/autologinfred 38400 tty1 Make sure the default run level in /etc/inittab is init 1 or init 3 id:3:initdefault: |
any idea why it doesn't seem to work right on slackware??
instead of automatically logging-in a user, it just asks for the password... like, at boot it will say "Password: " (without prompting for a username) and if you give it the password for the user you wanted to auto login it will then drop you to the shell like normal... the only way to log-in as another user is to switch to another console... this is what my /etc/inittab looks like: Code:
# These are the standard console login getties in multiuser mode: Code:
int main() { Code:
gcc autologin.c -o autologin Code:
-rwxr-xr-x 1 root bin 11066 2005-11-04 03:57 /usr/sbin/autologin |
I installed qlogin in a slackware box to autologin, it works well
(it requires a perl module : User::Utmp) http://freshmeat.net/redir/qlogin/16...l_tgz/software |
seems the reason it wouldn't work is because i needed to set the NO_PASSWORD_CONSOLE option in /etc/login.defs...
everything is working fine now... i set 3 ttys, tty3 being the one that is autologin... this is what my working setup looks like now: /etc/login.defs: Code:
NO_PASSWORD_CONSOLE tty3 Code:
c1:1235:respawn:/sbin/agetty 38400 tty1 linux Code:
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty3 ]; then Code:
tty1 |
thanks guys, someone asked me how to do this and this thread helped. i wrote down all the steps i followed: http://littlesvr.ca/linux-stuff/arti...ginconsole.php
cheers |
autologin
Thank you guys, this thread was very helpful.
What I enjoyed most is the "win32sux" password in the C code ... can't agree more! |
Quote:
|
Is there any problem I didn't notice using a shell script instead of C? Seems to work for me:
/etc/inittab: Code:
c1:1235:respawn:/sbin/agetty -l /path/to/autologin.sh -n 38400 tty1 linux Code:
#!/bin/sh /etc/inittab: Code:
c1:1235:respawn:/bin/su - username EDIT3: This is probably useless, since su starts a shell but doesn't open a tty port. Maybe a -c option can be added to start x or something. EDIT: What's the difference between: Code:
exec /bin/login -f username Code:
exec /bin/login -- username #this is what agetty does by default I didn't notice any difference: if one asks for password so does the other and vice-versa (according to /etc/login.defs NO_PASSWORD_CONSOLE item and presence of password). Is the -f option related to pam? I don't have pam installed. EDIT2: If someone finds it inconvenient that you can't logout without being immediately relogged in, you can use the action "once" instead of "respawn" in the inittab entry. If you don't want the tty to become useless after logout you can use a "wait" entry for the autologin, followed by the default "respawn" entry, both at the end of inittab: Code:
a1:1235:wait:/sbin/agetty -l /path/to/autologin.sh -n 38400 tty1 linux |
need help
followed same as above but iam using xinit. want to display window launcher on boot time using xinit with user account and having only one tty (tty1). disabled remaining ttys
if [ -z "$DISPLAY" ] && [ $(tty) = /dev/tty1 ]; then su -c "xinit ./myapp" <username> fi now my app wants to display at boot time without asking password in user account |
does anyone knows why NO_PASSWORD_CONSOLE doesn't work on slackware 14.1?
|
you DO KNOW that this is a 9 year old post about Debian3
and NOT a slackware post |
Quote:
|
Quote:
https://linuxgazette.net/72/chung.html |
All times are GMT -5. The time now is 03:15 AM. |