raspberrynewbB
Posts: 12
Joined: Fri Sep 29, 2017 6:32 am

[SOLVED] -- RASPBIAN STRETCH LITE how to enable autologin - Pi Zero W

Fri Nov 17, 2017 3:17 am

Hey there,

I recently bought the Pi Zero W and am attempting to run it headless.

I added the wpa_supplicant.conf file + the ssh file to the boot partition on the SD card. Booted the pi up (with HDMI connected the first time to make sure everything worked)....however, when I boot the Pi Zero W, it asks me to type the password before I can even access the terminal.

Also, when I try to SSH in my Pi is not detected. (I added blank ssh file to boot partition as well)

Is there a way to enable autologin on the Pi without using HDMI/mouse/keyboard? How can I run the Pi Zero W headless if its going to ask me for a password every time i boot?

Please help!!! Thanks
Last edited by raspberrynewbB on Fri Nov 17, 2017 5:26 pm, edited 2 times in total.

User avatar
Gavinmc42
Posts: 4526
Joined: Wed Aug 28, 2013 3:31 am

Re: RASPBIAN STRETCH LITE how to enable autologin - Pi Zero W

Fri Nov 17, 2017 3:31 am

I have also had trouble with Zero W, but it looks like new kernel 4.14 might fix this.
Very new, so option is bleeding edge 4.14 or persist with 4.9.

While waiting for a fix try external usb wifi?
I was about to look at that option until the 4.14 news today.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

W. H. Heydt
Posts: 12648
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: RASPBIAN STRETCH LITE how to enable autologin - Pi Zero W

Fri Nov 17, 2017 6:49 am

Use another system, such as a Windows PC. You can add a file to the boot partition (which is the only one Windows can access) named "ssh". You can also add a wpa_supplicant file to the boot partition. Then when you use that SD card to boot the Pi0W, ssh will be enabled and the wpa_supplicant file will be installed and you should see the Pi0W on your network. You'll still need ID and password to actually log in.

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: RASPBIAN STRETCH LITE how to enable autologin - Pi Zero W

Fri Nov 17, 2017 8:51 am

I have several PiZero and PiZeroW boards. I always run them headless.

I have no idea whether a directly connected monitor would ask for a login, as I never have a display connected. Even if such a prompt is issued unseen it does not block the normal complete startup of the Operating System, including the network.

If your RPi is not detectable on your network it will be because you have not configured the wireless Access Point association correctly in wpa_supplicant.conf .

fruitoftheloom
Posts: 23337
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: RASPBIAN STRETCH LITE how to enable autologin - Pi Zero W

Fri Nov 17, 2017 9:36 am

raspberrynewbB wrote:
Fri Nov 17, 2017 3:17 am
Hey there,

I recently bought the Pi Zero W and am attempting to run it headless.

I added the wpa_supplicant.conf file + the ssh file to the boot partition on the SD card. Booted the pi up (with HDMI connected the first time to make sure everything worked)....however, when I boot the Pi Zero W, it asks me to type the password before I can even access the terminal.

Also, when I try to SSH in my Pi is not detected.

Is there a way to enable autologin on the Pi without using HDMI/mouse/keyboard? How can I run the Pi Zero W headless if its going to ask me for a password every time i boot?

Please help!!! Thanks

?? maybe ??

https://medium.com/a-path-to-pi/adding- ... be6634716e
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot)..
Asus ChromeBox 3 Celeron is my other computer...

n67
Posts: 938
Joined: Mon Oct 30, 2017 4:55 pm

Re: RASPBIAN STRETCH LITE how to enable autologin - Pi Zero W

Fri Nov 17, 2017 9:44 am

Isn't auto-login on by default - since Jessie/Pixel?

I don't understand how the OP could have gotten it to be off.
"L'enfer, c'est les autres"

G fytc hsqr rum umpbq rm qyw rm rfc kmbq md rfgq dmpsk:

Epmu Sn!

J lnacjrw njbruh-carppnanm vxm rb mnuncrwp vh yxbcb!

User avatar
HawaiianPi
Posts: 5838
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: RASPBIAN STRETCH LITE how to enable autologin - Pi Zero W

Fri Nov 17, 2017 10:39 am

If you are using Raspbian Lite it will boot to a login prompt, and you'll need to enter the default username and password to login to the CLI. When using SSH you normally specify the user, so it will ask you for the password to login. Direct login and SSH login are separate processes (you can login to one, the other, or both, they are not interdependent).

Was the ssh file deleted from the SD card after you booted the Pi? And was the wpa_suplicant.conf file moved (neither should remain in the FAT32 boot partition after a successful boot). If either was still there, then something was wrong with your configuration.

How did you determine the IP address to SSH into your Pi Zero?

What did your wpa_supplicant.conf file look like? If you used the truncated file recommended for Jessie (with only the network section), it won't work in Stretch. Use the full wpa_supplicant.conf file with Stretch, which should look like this.

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US

network={
	ssid="Your network SSID"
	psk="Your WPA/WPA2 security key"
	key_mgmt=WPA-PSK
}
Edit country=, ssid= and psk= with your info.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

raspberrynewbB
Posts: 12
Joined: Fri Sep 29, 2017 6:32 am

Re: RASPBIAN STRETCH LITE how to enable autologin - Pi Zero W

Fri Nov 17, 2017 3:20 pm

HawaiianPi wrote:
Fri Nov 17, 2017 10:39 am
If you are using Raspbian Lite it will boot to a login prompt, and you'll need to enter the default username and password to login to the CLI. When using SSH you normally specify the user, so it will ask you for the password to login. Direct login and SSH login are separate processes (you can login to one, the other, or both, they are not interdependent).

Was the ssh file deleted from the SD card after you booted the Pi? And was the wpa_suplicant.conf file moved (neither should remain in the FAT32 boot partition after a successful boot). If either was still there, then something was wrong with your configuration.

How did you determine the IP address to SSH into your Pi Zero?

What did your wpa_supplicant.conf file look like? If you used the truncated file recommended for Jessie (with only the network section), it won't work in Stretch. Use the full wpa_supplicant.conf file with Stretch, which should look like this.

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US

network={
	ssid="Your network SSID"
	psk="Your WPA/WPA2 security key"
	key_mgmt=WPA-PSK
}
Edit country=, ssid= and psk= with your info.
thanks for your response...when I booted and could not SSH in I then powered off the pi and check the SD card again...SSH and wpa_supplicant files were still on the boot partition..i downloaded the OS right from raspberrypi.org and burned it following their instructions...any reason why you think it could have gone wrong?

i tried to ssh in using the same way I always connect to my Pi3's (ssh pi@raspberrypi.local)..as well, I used the full wpa_supplicant file just like you provided??

W. H. Heydt
Posts: 12648
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: RASPBIAN STRETCH LITE how to enable autologin - Pi Zero W

Fri Nov 17, 2017 3:41 pm

n67 wrote:
Fri Nov 17, 2017 9:44 am
Isn't auto-login on by default - since Jessie/Pixel?

I don't understand how the OP could have gotten it to be off.
On a GUI desktop, yes. On CLI in Raspbian Lite, no (so far as I know). When I use Raspbian Lite it's generally because I'm going to run headless and I still use id/password on remote login. Even if one is running the full desktop with autologin, coming in by ssh still needs id/password unless you use some other form of authentication.

I don't think this issue has much to do with different Raspbian releases. Remote login with id and password have been working that way back to Wheezy and still work that way with Stretch. It used to be that starting the GUI desktop wasn't the default. One logged in and then ran startx to get the GUI. Apparently that put some people off....

jahboater
Posts: 5759
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: RASPBIAN STRETCH LITE how to enable autologin - Pi Zero W

Fri Nov 17, 2017 4:07 pm

W. H. Heydt wrote:
Fri Nov 17, 2017 3:41 pm
coming in by ssh still needs id/password unless you use some other form of authentication.
Yes.

Its simple enough to set up for password less login (looks like auto login). Having done that, typing

ssh pi@host

goes straight in to the command prompt.
To set this up do (on the PC):-

ssh-keygen -t rsa

then

ssh-copy-id pi@host

Give the password once and it should be all set up.

Try ssh pi@host to test the autologin, you should never be asked for a password again!

raspberrynewbB
Posts: 12
Joined: Fri Sep 29, 2017 6:32 am

Re: RASPBIAN STRETCH LITE how to enable autologin - Pi Zero W

Fri Nov 17, 2017 5:25 pm

thanks all..between all your responses I ended up getting it to work...

for some reason the wpa_supplicant file i put onto the boot partition did not copy over to the root partition on boot.. also on my Mac I'm unaware how to access the root partition of the SD card because it wont let me mount?

regardless I just HDMI'd into the PiZeroW and edited the wpa_supplicant file in /etc/ manually and it worked

Return to “Beginners”