linux automatic login, startx and shutdown

making linux easier for noob and kids by automatic login into linux, then startx and then shutdown the computer when they quit.

first, setup mingetty for automatic login on debian minimal desktop:
# sudo aptitude install mingetty
# sudo nano -w /etc/inittab 
# then comment this line and add the next line:
# 1:2345:respawn:/sbin/getty 38400 tty1
1:2345:respawn:/sbin/mingetty --autologin replacewithyourusername tty1

or, on ubuntu minimal desktop:
# sudo aptitude install mingetty
# sudo nano -w /etc/event.d/tty1
# look at the last line
# comment this line and add the next line:
# exec /sbin/getty 38400 tty1 
exec /sbin/mingetty --autologin replacewithyourusername tty1

then allow everyone to shutdown:
sudo chmod +s /sbin/halt

then, automatic startx and shutdown after exiting x:
# nano -w .bashrc
# put these lines at the most bottom
if [ $(tty) == "/dev/tty1" ]; then
  startx
  /sbin/halt
fi
--
tips & tricks on computers and gadgets
denny on IT ; let's doIT
documenting the brain

Comments

cannoneerr said…
thanks a lot for sharing these comands to us and they can help us a lot in our daily using
qianjin00 said…
It's really difficult for me:(" I will make notes of your command lines. Thank you!
tech solution said…
I like this article, It may be helpful for others.Free Netflix Accounts 2019
Stephanie said…
Very nice blog you havee here