Page 1 of 1

ssh file issue

Posted: Thu Apr 13, 2017 4:09 am
by DaHai8
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.

Re: ssh file issue

Posted: Thu Apr 13, 2017 4:27 am
by wh7qq
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.

Re: ssh file issue

Posted: Thu Apr 13, 2017 5:53 am
by DaHai8
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.

Re: ssh file issue

Posted: Thu Apr 13, 2017 7:58 am
by Ernst
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.

Re: ssh file issue

Posted: Sat Dec 09, 2017 8:27 pm
by AlekEagle
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?

Re: ssh file issue

Posted: Sat Dec 09, 2017 8:56 pm
by klricks
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.