DaHai8
Posts: 55
Joined: Fri Jul 31, 2015 9:21 am

ssh file issue

Thu Apr 13, 2017 4:09 am

Not sure if its a bug, intended use, or something else, but I thought I'd report it here.
If you forget to add the 'ssh' file to the root of the SD Card Before booting up the Pi for the first time, then you won't be able to add it later. You'll need to reformat your SD Card and reload the Raspbian IMG file.
Not sure why its doing this, but if you add the 'ssh' file after booting the Pi for the first time, it just gets deleted and you can't SSH into it. period.

wh7qq
Posts: 1439
Joined: Thu Oct 09, 2014 2:50 am

Re: ssh file issue

Thu Apr 13, 2017 4:27 am

DaHai8 wrote:Not sure if its a bug, intended use, or something else, but I thought I'd report it here.
If you forget to add the 'ssh' file to the root of the SD Card Before booting up the Pi for the first time, then you won't be able to add it later. You'll need to reformat your SD Card and reload the Raspbian IMG file.
Not sure why its doing this, but if you add the 'ssh' file after booting the Pi for the first time, it just gets deleted and you can't SSH into it. period.
Not a bug or something else. You still must enable ssh in raspi-config or the Configuration GUI but there is no need to reformat and reload. You need to change the default password from "raspberry" to something else for it to work. You can also change the password in a terminal window with

Code: Select all

passwd pi
. The empty "ssh" file does go away if you boot up without it first.

DaHai8
Posts: 55
Joined: Fri Jul 31, 2015 9:21 am

Re: ssh file issue

Thu Apr 13, 2017 5:53 am

Well, if you can't connect a monitor and keyboard, and SSH is the only way to get to the Pi, then Yes, you Must reformat and reload the SD card.

Ernst
Posts: 1331
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: ssh file issue

Thu Apr 13, 2017 7:58 am

DaHai8 wrote:Well, if you can't connect a monitor and keyboard, and SSH is the only way to get to the Pi, then Yes, you Must reformat and reload the SD card.
Your conclusion is correct but the cause is (very likely) something else.

I have observed that not being able to ssh into a newly installed headless gadget mode Pi0 can be caused by removing power too early. A few things happen in the background when the Pi0 is booted for first time.

What I suggest is that you try the following procedure:
1) Prepare the card, update cmdline.txt and config.txt, create ssh file.
2) Plug one side of the USB cable into your computer
3) Plug the other side of the USB cable into the POWER port of the Pi0
4) Wait for the activity LED to stop blinking (takes a bit of time)
5) Remove cable from the power port and repeat steps 3&4 once more
6) Remove cable from the power port and plug into data port
7) Confirm that ethernet drivers are being loaded on PC
8) Test ssh

Using the power port in step 3 is to assure that the PC does not react on events from the USB port.
IMHO the problem is that removing the power to early can corrupt data on the SD card, like ssh keys that are generated during the boot process.
The road to insanity is paved with static ip addresses

AlekEagle
Posts: 10
Joined: Sat Nov 04, 2017 11:29 pm

Re: ssh file issue

Sat Dec 09, 2017 8:27 pm

im sshing ro my raspberry right now (dont have a screen for it yet) and whenever i edit the /etc/ssh/ssh_config file with nano it doesnt update when ever i preform a ssh reboot with /etc/init.d/ssh restart command is it because im stupid and should do this not sshing to it to change it or is this an actual bug?

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

Re: ssh file issue

Sat Dec 09, 2017 8:56 pm

AlekEagle wrote:
Sat Dec 09, 2017 8:27 pm
im sshing ro my raspberry right now (dont have a screen for it yet) and whenever i edit the /etc/ssh/ssh_config file with nano it doesnt update when ever i preform a ssh reboot with /etc/init.d/ssh restart command is it because im stupid and should do this not sshing to it to change it or is this an actual bug?
Your issue has nothing to do with the rest of this thread. I would suggest to create a new thread.
Be sure to use a meaningful subject title.
State the OS that you are using.
Give exact commands you are using and show any error messages.
Please use correct punctuation if you want people to respond.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

Return to “Troubleshooting”