LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-23-2009, 08:45 AM   #1
dsollen
Member
 
Registered: Jun 2009
Posts: 56

Rep: Reputation: 15
autologin at bootup securely


I'm trying to arrange for a user to automatically login at boot. I can't guarantee gnome or KDE will be installed or this would be easy. I goggled this and discovered the standard solution is modify innittab to run agetty -n -l /usr/sbin/autologin which would be a c program which looks like this

int main(){
execlp( "login", "login", "-f", "IIU", 0);
}

and finally modify /etc/login.def to add the NOPASSWORD argument to the ttl that is automatically logging in.

I've done this and it seems to work, but I have to questions related to it.

1) when I do this gnome still brings up a login manager for me to log in at bootup. it seems that the user I wanted logged in is still logged in and running but gnome covers this with it's own login prompt and requires a re-login. I actually don't mind that but it's not what I had expected, I expected to not have to log in once the autologin script was run. Is this due to gnome or would I see similar behavior without gnome installed?

2) I want to do this securely. Currently there are only two users on this machine, the one I want automatically logged in and have given limited security rights and root. In the future though more users may be added with elevated permissions. as I understand it using the NOPASSWD command in /etc/login.def would make any non root user able to login without a password, even if that user had elevated permissions. Is there a way to either modify the login.def file to only allow a specific user to login without a password, or to modify the autologin program run by agetty to include a password so I don't have to modify login.defs?

Actually I played with the login command and it has me confused. If I use login -f 'user name' it will prompt me for a password by always complains the password I provide is incorrect. I know the password I'm using is correct and can su without problems.


and before you ask I know there are other methods of getting what I desire (programs to run after reboot without needing a manual login), but my client requested this method so this is the method I’m going to use unless there a significant reason not to.
 
Old 09-23-2009, 06:46 PM   #2
mrclisdue
Senior Member
 
Registered: Dec 2005
Distribution: Slackware
Posts: 1,134

Rep: Reputation: 277Reputation: 277Reputation: 277
Change the default run level in /etc/inittab to 3, instead of 4 (or 5, depending on distro), so that the user is logged into a console, rather than GDM, or whatever. The user would then need a 'startx' for a gui.

This thread:

http://www.linuxquestions.org/questi...ut-gui-374338/

has been helpful to me.

hth
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Using Webmin Securely LXer Syndicated Linux News 0 02-27-2009 11:10 PM
Securely using VNC over SSH Vanyel Linux - Security 1 08-10-2007 10:54 PM
Securely wipe a harddisk drpixel404 Linux - General 15 07-15-2007 04:17 PM
gnome fails to load on login after bootup - unless bootup first in win xp doubletruncation Fedora 6 12-07-2005 08:32 AM
mysqld doesn't chroot securely markus1982 Linux - Security 12 03-07-2004 08:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration