LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Automatic User Login / Logon (https://www.linuxquestions.org/questions/linux-general-1/automatic-user-login-logon-304319/)

ciaran.mooney 03-21-2005 10:09 AM

Automatic User Login / Logon
 
Afternoon All,

I am trying to get my linux box to boot into a user account automatically. I'm not using KDE or Gnome and every search I do comes up with the same or similar results. Any other results go waaaay over my head.

I cant use KDE or Gnome because I didnt install them and there is very limited space left on the hard drive.

Recap

Automatic Login of User (without using KDE or Gnome)
Automatic starting of X

Any help will be appriciated,

Thanks,

Ciaran

Linux.tar.gz 03-21-2005 10:31 AM

Wdm is a light alternative to gdm and kdm.
http://voins.program.ru/wdm/
Easy to install, but tricky to configure.

But i think it's possible to do what you want with xdm, the default X display manager. Hope someone will post how, cause i'm interested too ^^.

And if someone knows how to install gdm in standalone, 'cause it's the best...

ciaran.mooney 03-22-2005 09:44 AM

I havnt tried your suggestion.

But I seemed to have found a solution

a small script added into rc.local

echo "user login"
cd /home/user
su - user

thats probably not exact - but seems to have done the trick.

Thing is it seems too simple. Ive checked that the user that is now automatically logged in cant change any of the /etc/ system files. But the inclusion of "su" in the script seems to worry me.

Are these fears unfounded or am i right?

Ciarán

Linux.tar.gz 03-22-2005 09:57 AM

This is fun!!
What happens if you type exit?

bullium 03-22-2005 10:50 AM

Quote:

Originally posted by ciaran.mooney
I havnt tried your suggestion.

But I seemed to have found a solution

a small script added into rc.local

echo "user login"
cd /home/user
su - user

thats probably not exact - but seems to have done the trick.

Thing is it seems too simple. Ive checked that the user that is now automatically logged in cant change any of the /etc/ system files. But the inclusion of "su" in the script seems to worry me.

Are these fears unfounded or am i right?

Ciarán

Your not using the su command alone your using it to switch to the user your specifying. Where as su alone will give you root.

Try this at a terminal while your logged into the box.
Code:

su username

ciaran.mooney 03-24-2005 04:29 AM

Quote:

Originally posted by Linux.tar.gz
This is fun!!
What happens if you type exit?

God knows - the user it logs into can only open Mozilla, Abiword, and Shutdown. Cant access the command prompt/shell.

Thanks for the reassurance.

Ciarán

repentorperish 04-06-2005 02:25 PM

i agree that there's something wrong with this... waaay too easy... i've been trying to get autologin working with agetty and mingetty for some time now but i can't avoid getting a password prompt. this is the "correct" way of doing it, though, and there are instructions here:

mingetty (requires you to compile + install the mingetty package): http://easymamecab.mameworld.net/html/autologin.htm
agetty (the default that slackware uses): http://www.linuxgazette.com/issue72/chung.html

but your hack works for me...

if you want to log into a bash shell then use the following in /etc/rc.d/rc.local:

echo "user login"
cd /home/user
su - user -c /bin/bash -l

typing exit returns you to a login prompt (because you haven't changed anything in /etc/inittab).

as soon as bash is run, it executes everything in .bashrc (if you start it like this -- if you log in at a prompt then it seems to prefer .profile), so if you want to start x then there ought to be a way of doing it in here, but it seems that PATH and some other variables aren't set as they'd normally be, so there could be some messing around involved. you'll probably get a warning that job control isn't enabled too; i don't know how to fix this. ideas? it also kills the other terminals until you log out, which may or may not be a good thing.

hth.

dan


All times are GMT -5. The time now is 06:11 AM.