LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Fluxbox autologin (http://www.linuxquestions.org/questions/slackware-14/fluxbox-autologin-474464/)

linuxhippy 08-16-2006 01:00 PM

Fluxbox autologin
 
I have my pc setup to graphically login to Fluxbox (inittab is set to 5). How can I set it up to autologin since it's in my house?

hitest 08-16-2006 01:39 PM

The graphical log-in for Slackware is run level 4. Just set your inittab to 4 and you're good to go:-)

piete 08-16-2006 04:19 PM

For auto-login it will depend on which login manager you use to get into graphical (run level 4) ...

For KDM try here: http://www.ltsp.org/contrib/autologin_kdm.html

For GDM try here (do we still include GDM since dropping gnome?): http://ubuntuforums.org/archive/index.php/t-12777.html

For XDM, can't be done: http://www.monkey.org/openbsd/archiv.../msg01826.html

Autologin WITHOUT any of the session managers! http://members.tripod.com/rpragana/short-commands.html

I personally use GDM to autologin a user for my Freevo box, so I suspect I could fish out the config that you need to adjust if you needed word-for-word instructions. I tried the KDE method (since it was one of the first comprehensive walkthroughs I found) but could NOT get it to work. You may have more luck.

Good luck and let us know how it goes!
- Piete.

Edit: We will all assume you're using Slackware, since you posted here, but if your inittab is set to 5, then you won't get anything graphical. Unless you've editted the rest of inittab to match your Fedora box?

From cat /etc/inittab :

Code:

# These are the default runlevels in Slackware:
#  0 = halt
#  1 = single user mode
#  2 = unused (but configured the same as runlevel 3)
#  3 = multiuser mode (default Slackware runlevel)
#  4 = X11 with KDM/GDM/XDM (session managers)
#  5 = unused (but configured the same as runlevel 3)
#  6 = reboot


linuxhippy 08-16-2006 08:11 PM

Actually the pc I'm writing about is using Vector Linux which is very close to Slackware that I'm using on 2 other pcs. XDM is used, so I cannot use that for autologin. I will change it to boot to the console so I can autologin there-thanks for the links!!

drkstr 08-16-2006 09:36 PM

I have auto login with XDM, here's how:

edit the /etc/inittab as follows:
Code:

x1:4:wait:/etc/rc.d/rc.xinit
(replacing the line that looks similar to this)

in the /etc/rc.d/rc.xinit:
Code:

#!/bin/sh
startx -- -bpp 24 | su - username

although it has been suggested to me by Daga that this would be better for the rc.xinit file
Code:

HOME='/home/username'
sudo -u username /bin/bash /usr/X11R6/bin/startx

First one I have tested, second I have not.

regards,
...drkstr

linuxhippy 08-21-2006 09:18 AM

My /etc/sudoers file is empty. Do I need to add to that to get the above sudoers command to work for login? If so, what do I add?

drkstr 08-21-2006 09:38 AM

No for the first method, I'm not sure on the second. I don't belive so since you do not need root to startx. But if it doesn't work, try adding this to your sudoers file.
Code:

username ALL= NOPASSWD: /usr/X11R6/bin/startx
...buy the way, I noticed a type in my previous post. startx resides in /usr/X11R6/bin, not /usr/bin. I just updated it.

regards,
...drkstr

linuxhippy 08-26-2006 01:39 PM

Well, I tried a couple different scenarios and got xauthority errors. Here's the message I got:

/usr/X11R6/bin/startx: line 133 : xauth: command not found
this error repeats to line 145

If I login and then type startx it works fine. I think it has to do with /etc/sudoers which had 1 line already and I added the last line:

root ALL=(ALL) ALL
username ALL= NOPASSWD: /usr/X11R6/bin/startx


Any ideas?

EDIT:

I googled around and saw that error is caused by /usr/X11R6/bin not being in the path of root or the user (huntz). I added that to the path and on reboot get the same xauth error.

drkstr 08-26-2006 02:20 PM

I finally tested it and it works just like it should once you add the path like you said. Here is the contents of my rc.xinit:
Code:

#!/bin/sh
HOME='/home/drkstr'
PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin"
PATH="$PATH:/usr/X11R6/bin:/opt/kde/bin"
sudo -u drkstr /bin/bash /usr/X11R6/bin/startx

I'm using KDE on this laptop so I added /opt/kde/bin. You won't need that one however. It's possible you don't need to add all this to your path, but it works, and it doesn't hurt to have them there.

Also, no need to add anything to the sudoers file (except the default entry for root). The sudu command is being run by root which is why it can be run with no password by default.

This method is a much better way to do it then the one I was using since it will allow you to disable the user's shell if you want to.

regards,
...drkstr

Tinkster 08-26-2006 03:57 PM

I still can't understand why someone would want to do that. It's like
leaving the keys in the car over night, with the door ajar. Even if there's
no one living there who may take advantage, the house can still be burgled.


Cheers,
Tink

linuxhippy 08-26-2006 04:00 PM

Excellent-that worked! I was starting to wonder if it was possible in Vector Linux 4.3 since it's 2 years old and uses xdm. /etc/rc.d/rc.X (it says it's a 1993 file from Slackware) is the file that I replaced with /etc/rc.d/rc.xinit in drkstr's previous post. Then in /etc/inittab I changed the file naming of rc.X to rc.xinit and rebooted.

Thanks for all the help-this is my 4th Linux pc that I've setup as a Jukebox using xmms and 10 GB of mp3 song files. Now all you do is cut on the power and it automatically logs in and executes a shuffled xmms jukebox from the harddrive...it uses fluxbox since it only has 128 MB RAM and a CPU of 700 MHz.

EDIT:

Of course my house could be broken into...a $50 pc is going to be the least of my worries if that happpens!!

fotoguy 08-26-2006 08:47 PM

Quote:

Originally Posted by Tinkster
I still can't understand why someone would want to do that. It's like
leaving the keys in the car over night, with the door ajar. Even if there's
no one living there who may take advantage, the house can still be burgled.


Cheers,
Tink

Most of the time this is not advisable but there are some cases where this is needed. For me, building a livecd it makes sense to autologin rather than having to type in a password every time you use it.

drkstr 08-27-2006 12:43 AM

Quote:

I still can't understand why someone would want to do that. It's like
leaving the keys in the car over night, with the door ajar. Even if there's
no one living there who may take advantage, the house can still be burgled.
hehe. I used to say the same thing until I actually ran into a situation when I needed it. I don't use it do it on my home computer though. Even if I am the only person using it.

see you around Tink!
...drkstr


All times are GMT -5. The time now is 12:20 PM.