olewolf
Posts: 9
Joined: Tue Feb 07, 2017 9:12 am

/boot/ssh file disappearing

Tue Feb 07, 2017 9:51 am

Sometimes when I reboot my Raspberry Pi device, it deletes the /boot/ssh file that I've manually created in order to login via SSH, and so I have to recreate it.

Why is this happening, and how do I prevent it?

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5343
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: /boot/ssh file disappearing

Tue Feb 07, 2017 9:54 am

If the file is removed, you know it worked. You no longer need it.

olewolf
Posts: 9
Joined: Tue Feb 07, 2017 9:12 am

Re: /boot/ssh file disappearing

Tue Feb 07, 2017 9:58 am

ShiftPlusOne wrote:If the file is removed, you know it worked. You no longer need it.
Not until I want to login again, that is, and I need to be able to always login via SSH.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5343
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: /boot/ssh file disappearing

Tue Feb 07, 2017 10:06 am

SSH will remain enabled until you manually disable it. If that's not the case, something else is wrong.

olewolf
Posts: 9
Joined: Tue Feb 07, 2017 9:12 am

Re: /boot/ssh file disappearing

Tue Feb 07, 2017 10:17 am

ShiftPlusOne wrote:SSH will remain enabled until you manually disable it. If that's not the case, something else is wrong.
Well, evidently something else is wrong then. It does indeed seem that /boot/ssh gets deleted and then--for a while at least--we can login after a reboot. But all of a sudden SSH refuses connections until we manually reestablish /boot/ssh. Is there a bug reporting facility somewhere where I can file a bug description?

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5343
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: /boot/ssh file disappearing

Tue Feb 07, 2017 1:49 pm

If you are able to login to the pi directly (without SSH) after SSH starts failing, please post the output of

Code: Select all

ifconfig
ping google.com
sudo systemctl status sshd

klricks
Posts: 5899
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: /boot/ssh file disappearing

Tue Feb 07, 2017 1:58 pm

olewolf wrote:
ShiftPlusOne wrote:SSH will remain enabled until you manually disable it. If that's not the case, something else is wrong.
Well, evidently something else is wrong then. It does indeed seem that /boot/ssh gets deleted and then--for a while at least--we can login after a reboot. But all of a sudden SSH refuses connections until we manually reestablish /boot/ssh. Is there a bug reporting facility somewhere where I can file a bug description?
Is your ssh (port 22) open to the Internet?
Do you properly power down the RPi?
I would re-image the SD card or put a fresh image on a new card and give that a try.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Stretch w/ Desktop OS.

olewolf
Posts: 9
Joined: Tue Feb 07, 2017 9:12 am

Re: /boot/ssh file disappearing

Tue Feb 07, 2017 2:14 pm

ShiftPlusOne wrote:If you are able to login to the pi directly (without SSH) after SSH starts failing, please post the output of

Code: Select all

ifconfig
ping google.com
sudo systemctl status sshd
We're using a minimal, headless RPi, so unfortunately this isn't readily possible.

However, the RPi is ping-able, and on attempting to SSH-login to the RPi, it immediately responds with "connection refused" rather than timing out, so there's network connectivity all right and there's evidently something listening (albeit refusing connections) on port 22. Power cycling the Pi doesn't help; the login problem remains until /boot/ssh is recreated.
klricks wrote:Is your ssh (port 22) open to the Internet?
Do you properly power down the RPi?
I would re-image the SD card or put a fresh image on a new card and give that a try.
Yes, port 22 is open to the LAN. That's how we had managed to connect to it until before the reboot. ;)

We have issued the "sudo reboot" command or "sudo shutdown -h now" command to reboot or power down the RPi, so it was shut down properly. The SD-card is good suspect but we've seen it happen on different SD cards.

User avatar
RaTTuS
Posts: 10110
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: /boot/ssh file disappearing

Tue Feb 07, 2017 2:29 pm

I'd temporary hook a monitor to it and see what is happening
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
dano9672
Posts: 3
Joined: Wed Feb 08, 2017 9:37 pm

Re: /boot/ssh file disappearing

Wed Feb 08, 2017 9:49 pm

I have several Pi's and am having the same problem on the one running the latest jessie (2017-1-11). I had an earlier jessie that did the same thing (still pixel version), and upgraded to this one. When I hook a display to it I see that it boots into an emergency console. Oddly, I can start a VNC console @ :1 (manually) and that works. The Pi is ONLY refusing ssh connections.

My older Pi's are running pre-pixel versions and are working just fine. I will definitely NOT be upgrading them.

Oh, is there somewhere I can download old versions of raspian jessie?

User avatar
dano9672
Posts: 3
Joined: Wed Feb 08, 2017 9:37 pm

Re: /boot/ssh file disappearing

Thu Feb 09, 2017 1:03 am

I’m having a similar problem. After I set my newest one up, and ssh is working, I will reboot or power off and the ssh server will stop working. I get "connection refused" almost immediately. I have several Pi's and the others (at earlier releases of jessie) are fine. Only my RasPi3, running the latest jessie (2017-01-11) is having trouble. Upon attaching a display it boots into an emergency recovery console. I can ping the another Pi, and can start the vnc server as :1 and attach to that, but ssh will no longer work. I have tried several SD cards, and even upgraded it to boot from USB. Is there anywhere to download earlier versions of jessie?

User avatar
RaTTuS
Posts: 10110
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: /boot/ssh file disappearing

Thu Feb 09, 2017 7:35 am

rather than looking for old versions ,m
find out what it is that is failing and /. or making it go into rescue mode
[power ? , something your running , memory ]?

and fix the current one so all fixes go forward ...
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
dano9672
Posts: 3
Joined: Wed Feb 08, 2017 9:37 pm

Re: /boot/ssh file disappearing

Thu Feb 09, 2017 5:12 pm

Got it. It was going into rescue mode because I had to disconnect it from the usb hub (which had a storage key that was defined in fstab). I commented out that line in /etc/fstab and it works, so now I'll have to work on that.....

As for the SSH, it seems to be working for the moment. So my question is, why can't SSH work if the Pi defaults to emergency mode? (Especially since VNC worked).

johnathansmith69
Posts: 5
Joined: Sun Sep 11, 2016 10:49 pm

Re: /boot/ssh file disappearing

Tue Oct 23, 2018 9:27 pm

I am using a Mac and trying to create the ssh file but once I remove the SD card from the Mac the file is missing.. I try taking the SD card out of the Mac and then back in and no SSH file

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

Re: /boot/ssh file disappearing

Tue Oct 23, 2018 10:23 pm

johnathansmith69 wrote:
Tue Oct 23, 2018 9:27 pm
I am using a Mac and trying to create the ssh file but once I remove the SD card from the Mac the file is missing.. I try taking the SD card out of the Mac and then back in and no SSH file

The symptoms you describe are consistent with the microSD card having become read-only.

If you create any other trivial file on the card does the same thing happen?

Note that the ssh marker file to enable the SSH server in the Raspbian Operating System is intended to disappear once the RPi has successfully booted from a card prepared in such a way.

PROGRAMMERNO
Posts: 1
Joined: Mon Oct 29, 2018 2:54 pm

Re: /boot/ssh file disappearing

Mon Oct 29, 2018 3:08 pm

Hi man ,my english not good ,but maybe this will be useful!,I found this problem like you just like,after many resetting and trying.I got success finally in this way: use the cmd if your pc are running windows and

Code: Select all

arp -a
,
when your raseberry pi connect the seam network with your pc ,the screen should list many ip addresses just like this 👇,just try to use ssh connect them ono by one. My problem is I always use a wrong ip address to connect ,i successed when i try an another.
Attachments
2018-10-29 (2).png
2018-10-29 (2).png (55.29 KiB) Viewed 328 times

Return to “Troubleshooting”