Page 1 of 1

Auto Login Questions

Posted: Tue Sep 29, 2015 7:22 pm
by hanniabu
I have a few questions about auto login:

1. I am currently follwing this instructional to set up auto login:
http://www.elinux.org/RPi_Debian_Auto_Login
It says to comment out this line:

Code: Select all

1:2345:respawn:/sbin/getty 115200 tty1
However, my line looks like this:

Code: Select all

1:2345:respawn:/sbin/getty --noclear 38400 tty1
So my first question is, can somebody explain the parts of this line? What is respawn, 115200/38400, --noclear, and tty1? Any ideas why mine is different?


2. The next part says to add this line:

Code: Select all

1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
What are -f and </dev/tty1 >/dev/tty1 2>&1? Also, I deleted the pi user and added another user as one of a few attempts to make it a bit more secure. I'm assuming I should replace the "pi" part with my new username.


3. I still want to setup the auto login regardless, but I would like to know - must a user be logged in to auto-run a script? Does this change if this script is run as a cron job or a service?


Thanks for the help in advanced. As a novice I'm trying to learn as much as I can to actually learn instead of blindly following tutorials.

Re: Auto Login Questions

Posted: Tue Sep 29, 2015 8:42 pm
by DougieLawson
It's a million times easier to forget that ancient wiki entry and use sudo raspi-config to choose whether you login to a command line, auto login to a desktop or auto login to Scratch.

Re: Auto Login Questions

Posted: Tue Sep 29, 2015 9:05 pm
by hanniabu
DougieLawson wrote:It's a million times easier to forget that ancient wiki entry and use sudo raspi-config to choose whether you login to a command line, auto login to a desktop or auto login to Scratch.
Thank you Dougie, I love seeing your responses as they're always informative. However, it is my understanding that choosing the login to the command line does not automatically log you in, which is what I hope to achieve. Also I would still like to know what the difference components in those lines mean if you happen to know yourself. Thanks again!

Re: Auto Login Questions

Posted: Tue Sep 29, 2015 10:22 pm
by rpdom
hanniabu wrote:I have a few questions about auto login:

1. I am currently follwing this instructional to set up auto login:
http://www.elinux.org/RPi_Debian_Auto_Login
It says to comment out this line:

Code: Select all

1:2345:respawn:/sbin/getty 115200 tty1
However, my line looks like this:

Code: Select all

1:2345:respawn:/sbin/getty --noclear 38400 tty1
So my first question is, can somebody explain the parts of this line? What is respawn, 115200/38400, --noclear, and tty1? Any ideas why mine is different?
"man inittab" will tell you what the '1', '2345' and 'respawn' bits refer to. "man getty" will explain the rest of the line.

Re: Auto Login Questions

Posted: Wed Sep 30, 2015 5:19 pm
by DougieLawson
hanniabu wrote: Thank you Dougie, I love seeing your responses as they're always informative. However, it is my understanding that choosing the login to the command line does not automatically log you in, which is what I hope to achieve. Also I would still like to know what the difference components in those lines mean if you happen to know yourself. Thanks again!
Go and read the code in /usr/bin/raspi-config it's a bash shell script. You can hack that to get a command line autologin.

Re: Auto Login Questions

Posted: Wed Sep 30, 2015 6:55 pm
by hanniabu
DougieLawson wrote: Go and read the code in /usr/bin/raspi-config it's a bash shell script. You can hack that to get a command line autologin.
I'll look into those, thanks for the leads guys!