-
Notifications
You must be signed in to change notification settings - Fork 0
setting up sshd
As the firmware, along with configuration directories, is mostly contained in a squashfs file, nothing in there can be modified. Luckily can an opensshd binary be found outside of the squashfs. It is unconfigured, but provides a script to s et it up.
The generated configuration needs minor customizing. Most important change is the location where public ssh key for password-free authentication is located.
Location of opensshd is in /ac_lib/lib/openssh.
First, a default configuration is generated, along with host keys:
cd /ac_lib/lib/openssh
./sshd_start
It takes a while for all requirements to be generated. In /ac_lib/lib/openssh/etc can the results be found.
terminate the still running instance of sshd:
read pid < /var/run/sshd.pid
kill $pid
Alternatively, restart your printer, or just its software, by executing
ŕeboot
(after which you will have to shell to the printer again, and change to the openssh directory again)
The file sshd_config in the etc directory needs customization. Open it in an editor. Provided as editor is the busybox interpretation of vi. If you don't feel comfortable with vi, transfer the file, using adb, to your host computer, edit it there, then transfer it back.
vi etc/sshd_config
In that file, change the line
AuthorizedKeysFile .ssh/authorized_keys
by moving the cursor to the line and pressing the "i" key (allowing editing).
Let it point to a file with an writable absolute location. That location could be on your thumb drive, or alternatively the ssh configuration directory. In that case should that line be changed to:
AuthorizedKeysFile /ac_lib/lib/openssh/etc/authorized_keys
Save the file (Esc:wq )
Assuming that you have already created an ssh key pair in the past (login attempt to Kobra 3 using ed25519 keys wasn't sucessful, but rsa keys are ok), copy the public key to the file authorized_keys on Kobra 3. This command must be executed on your computer, not on Kobra 3:
adb push id_rsa.pub /ac_lib/lib/openssh/etc/authorized_keys
set permissions of that file (executing on Kobra 3 again, still in directory /ac_lib/lib/openssh):
chmod 600 etc/authorized_keys
restart opensshd wit the new configuration:
./sshd_start
You should now be able to shell to the printer from your computer, using ssh: `ssh kobra3'