I've set up a few Pi's in the past with all of them automatically logging into the default user account on startup. This has been done by following these instructions:
http://elinux.org/RPi_Debian_Auto_Login
However, with my new Raspberry Pi after running apt-get update and apt-get upgrade, this doesn't seem to work anymore. I added this line to the bottom of initttab:
1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
Does this no longer work? I noticed 1:2345 seems to be replaced now with T0:23. But if I try this...
T0:23:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
... it totally destroyed my ability to use my Pi any longer.
Re: Automatic login no longer working?
By the way, this is what the bottom of my inittab file looks like:
Code: Select all
# /etc/inittab: init(8) configuration.
# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $
# The default runlevel.
id:2:initdefault:
# Boot-time system configuration/initialization script.
# This is run first except when booting in emergency (-b) mode.
si::sysinit:/etc/init.d/rcS
# What to do in single-user mode.
~~:S:wait:/sbin/sulogin
# /etc/init.d executes the S and K scripts upon change
# of runlevel.
#
# Runlevel 0 is halt.
# Runlevel 1 is single-user.
# Runlevels 2-5 are multi-user.
# Runlevel 6 is reboot.
l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
# Normally not reached, but fallthrough in case of emergency.
z6:6:respawn:/sbin/sulogin
# What to do when CTRL-ALT-DEL is pressed.
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
# Action on special keypress (ALT-UpArrow).
#kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this work."
# What to do when the power fails/returns.
pf::powerwait:/etc/init.d/powerfail start
pn::powerfailnow:/etc/init.d/powerfail now
po::powerokwait:/etc/init.d/powerfail stop
# /sbin/getty invocations for the runlevels.
#
# The "id" field MUST be the same as the last
# characters of the device (after "tty").
#
# Format:
# <id>:<runlevels>:<action>:<process>
#
# Note that on most Debian systems tty7 is used by the X Window System,
# so if you want to add more getty's go ahead but skip tty7 if you run X.
#
1:2345:respawn:/sbin/getty --noclear 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
5:23:respawn:/sbin/getty 38400 tty5
6:23:respawn:/sbin/getty 38400 tty6
# Example how to put a getty on a serial line (for a terminal)
#
#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100
# Example how to put a getty on a modem line.
#
#T3:23:respawn:/sbin/mgetty -x0 -s 57600 ttyS3
#Spawn a getty on Raspberry Pi serial line
#1:2345:respawn:/sbin/getty 115200 tty1
1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
-
- Posts: 4277
- Joined: Sun Jan 15, 2012 1:11 pm
Re: Automatic login no longer working?
Note that that advice (on that page) is pretty much out-of-date and should be ignored.
It's not the best method for doing this.
It's not the best method for doing this.
And some folks need to stop being fanboys and see the forest behind the trees.
(One of the best lines I've seen on this board lately)
(One of the best lines I've seen on this board lately)
Re: Automatic login no longer working?
What method should be used?
Re: Automatic login no longer working?
It doesn't say to add
to the end of the file.
It says to find the existing
line, put a "#" in front of it and add the new line directly after it.
As you haven't put a # in front of the original line in the file it will still get executed and ask for a login as normal, and your new line will never be used.
Code: Select all
#1:2345:respawn:/sbin/getty 115200 tty1
1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
It says to find the existing
Code: Select all
1:2345:respawn:/sbin/getty 115200 tty1
As you haven't put a # in front of the original line in the file it will still get executed and ask for a login as normal, and your new line will never be used.
Re: Automatic login no longer working?
If you look at the full code I posted, isn't this the case? I commented out the original line and added the new one.
Re: Automatic login no longer working?
Just like rpdom said, you are not supposed to add:
... but to comment (#) the existing
After that, add the following line below the previous one ( i.e the commented one )
Your file contains twice:
Just delete the second
... which is at the bottom of your file.
Code: Select all
#1:2345:respawn:/sbin/getty 115200 tty1
1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
Code: Select all
1:2345:respawn:/sbin/getty 115200 tty1
Code: Select all
1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
Code: Select all
#1:2345:respawn:/sbin/getty 115200 tty1
1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
Code: Select all
1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
Re: Automatic login no longer working?
I think there's some confusion here. Again, if you look at the full code I posted, this line appears once and only once. The line that I was supposed to comment out is indeed commented out. There are no extra commands like you're suggesting.
Here's the full code again:
"1:2345:respawn:/sbin/getty 115200 tty1" appears once and only once, and it is commented out. Yet the Pi still will not automatically log me in.
Apologies if I'm being dense, but I don't see what you are referring to.
Here's the full code again:
Code: Select all
# /etc/inittab: init(8) configuration.
# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $
# The default runlevel.
id:2:initdefault:
# Boot-time system configuration/initialization script.
# This is run first except when booting in emergency (-b) mode.
si::sysinit:/etc/init.d/rcS
# What to do in single-user mode.
~~:S:wait:/sbin/sulogin
# /etc/init.d executes the S and K scripts upon change
# of runlevel.
#
# Runlevel 0 is halt.
# Runlevel 1 is single-user.
# Runlevels 2-5 are multi-user.
# Runlevel 6 is reboot.
l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
# Normally not reached, but fallthrough in case of emergency.
z6:6:respawn:/sbin/sulogin
# What to do when CTRL-ALT-DEL is pressed.
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
# Action on special keypress (ALT-UpArrow).
#kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this work."
# What to do when the power fails/returns.
pf::powerwait:/etc/init.d/powerfail start
pn::powerfailnow:/etc/init.d/powerfail now
po::powerokwait:/etc/init.d/powerfail stop
# /sbin/getty invocations for the runlevels.
#
# The "id" field MUST be the same as the last
# characters of the device (after "tty").
#
# Format:
# <id>:<runlevels>:<action>:<process>
#
# Note that on most Debian systems tty7 is used by the X Window System,
# so if you want to add more getty's go ahead but skip tty7 if you run X.
#
1:2345:respawn:/sbin/getty --noclear 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
5:23:respawn:/sbin/getty 38400 tty5
6:23:respawn:/sbin/getty 38400 tty6
# Example how to put a getty on a serial line (for a terminal)
#
#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100
# Example how to put a getty on a modem line.
#
#T3:23:respawn:/sbin/mgetty -x0 -s 57600 ttyS3
#Spawn a getty on Raspberry Pi serial line
#1:2345:respawn:/sbin/getty 115200 tty1
1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
Apologies if I'm being dense, but I don't see what you are referring to.
Re: Automatic login no longer working?
Okay, I see my confusion. The line I needed to comment out was "1:2345:respawn:/sbin/getty --noclear 38400 tty1"
I guess I was following the instructions too literally, where it listed the line as "1:2345:respawn:/sbin/getty 115200 tty1". I'm assuming this must have changed with the more recent Raspi release.
I guess I was following the instructions too literally, where it listed the line as "1:2345:respawn:/sbin/getty 115200 tty1". I'm assuming this must have changed with the more recent Raspi release.
Re: Automatic login no longer working?
Sorry, maybe we should have been more clear on that too.telarium wrote:Okay, I see my confusion. The line I needed to comment out was "1:2345:respawn:/sbin/getty --noclear 38400 tty1"
I guess I was following the instructions too literally, where it listed the line as "1:2345:respawn:/sbin/getty 115200 tty1". I'm assuming this must have changed with the more recent Raspi release.
The "1:2345:" identifies the line and when it will be used. The rest of the line is what it should do.
Re: Automatic login no longer working?
The line you tried in fact doesn't work. What you want to use is:
thanks to:
http://raspberrypi.stackexchange.com/qu ... n-raspbian
Code: Select all
#1:2345:respawn:/sbin/getty --noclear 38400 ttyl
1:2345:respawn:sbin/getty --autologin {USERNAME} --noclear 38400 tty1
http://raspberrypi.stackexchange.com/qu ... n-raspbian