ssh not working on beaglebone after flashing eMMC

Dear,

It appears that I cannot ssh my BBB REVC after having flashed my eMMC using the the Robert Nelson script bbb-eMMC-flasher-eewiki-ext4.sh
My kernel version is 4.1.21-bone-rt-r20.
I have checked the etc/ssh/ directory and I could see that all the ssh_host … files are gone as a result that I cannot establich any ssh connection to the board via the port22 while I can ping the board and access the apache webserver.

Is there a way to recover all this files so that I can restore the SSH connection?

thanks in advance for a reply.
``

They should be auto-generated on first bootup:

bbb-eMMC-flasher-eewiki-ext4.sh, set's the trigger file: /etc/ssh/ssh.regenerate

https://github.com/RobertCNelson/boot-scripts/blob/master/tools/eMMC/bbb-eMMC-flasher-eewiki-ext4.sh#L342-L346

Then the script on bootup that see's that, will delete /etc/ssh/* and
regenerated it via:

https://github.com/RobertCNelson/boot-scripts/blob/master/boot/generic-startup.sh#L12-L33

Regards,

Hello Robert,

It looks like some steps failed since I can see that under /etc/ssh there are only 4 files moduli ssh_config sshd_config and ssh.regenerate.
Is there a way to regenerate the missing files or repeat the bbb-eMMC-flasher-eewiki?

sudo dpkg-reconfigure openssh-server
sync
sudo rm -f /etc/ssh/ssh.regenerate

Regards,

Hi Robert,

I have tried the command line as you advise but this time I got the followng error:

/usr/sbin/dpkg-reconfigure: line 6: syntax error near unexpected token{’
/usr/sbin/dpkg-reconfigure: line 6: if (exists $ENV{DEBCONF_USE_CDEBCONF} and $ENV{DEBCONF_USE_CDEBCONF} ne '') {'

I have searched a solution on the internet but I couldn’t find it any idea how to solve it?

I have tried

The problem is not openssh-server, the problem is your system is somehow corrupt. Which can happen from a bad install. It ended prematurely for a number of reasons. OR you started screwing around with a good install, and messed it up.

Start over again, and if the image you have does the same thing again, get a different image.

Hi William,

thanks for replying. Indeed something went wrong with some driver update as a consequence that my system completely has been screwed up.
I have just rebuild another image from the native Kernel source and booting the board from SD card.

Cheers,

Beninio