hanniabu
Posts: 7
Joined: Tue Aug 18, 2015 8:09 pm

Auto Login Questions

Tue Sep 29, 2015 7:22 pm

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.

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Auto Login Questions

Tue Sep 29, 2015 8:42 pm

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.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

hanniabu
Posts: 7
Joined: Tue Aug 18, 2015 8:09 pm

Re: Auto Login Questions

Tue Sep 29, 2015 9:05 pm

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!

User avatar
rpdom
Posts: 17275
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Auto Login Questions

Tue Sep 29, 2015 10:22 pm

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.

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Auto Login Questions

Wed Sep 30, 2015 5:19 pm

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.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

hanniabu
Posts: 7
Joined: Tue Aug 18, 2015 8:09 pm

Re: Auto Login Questions

Wed Sep 30, 2015 6:55 pm

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!

Return to “Beginners”