SSH active on flash


#1

Is there a way to have have ssh working and accessible as soon as a flash with etcher? I would like to be able to just plug in my rockpi4 to the network without a display or anything and be able to connect remotely without any additional setup.

Is this possible?


#2

I was neither able to install head less with Ubuntu Server nor with Armbian Desktop. I suppose it’s still switched off by the developers. Theoretically it seemed to be possible under Armbian, ssh access was allowed, the openssh-server was also installed, but it couldn’t create the host keys, so the login was prevented. So I first uninstalled it, purged it and reinstalled it, then it worked with the keys. I also didn’t manage to establish a serial connection with the special baudrate 1500000. I have tried it first with four different USB to serial converters and also still with a Raspberry Pi Zero W. I have a third screen within reach, but I prefer to install head less from the beginning.


#3

Yes, it’s possible to “pre-install” something before flash with ether. Here is the hack:

sudo apt-get install gcc-aarch64-linux-gnu device-tree-compiler libncurses5 libncurses5-dev build-essential libssl-dev mtools
sudo apt-get install bc python dosfstools
sudo apt-get install binfmt-support qemu-user-static cpio gdisk

Now mount the gpt image, 134217728 is the start of the rootfs.

sudo mount -o loop,offset=134217728 rockpi4b-ubuntu-bionic-minimal-20190104_2101-gpt.img /mnt/
sudo chroot /mnt

Now you are in the “rockpi rootfs”,

root# apt-get install ssh
root# exit

umount the image

sudo umount /mnt
sudo sync

Write the image with etcher.