06-19-2025 03:54 AM
Hi
I have been working through the chroot trick described in:
https://labviewwiki.org/wiki/Chroot_SSH_trick
step 1: I can install OpenSSH to the chroot successfully.
step 2: I can generate the SSH key and move it to the /srv/chroot/labview/root/.ssh location (this is verified with FileZilla).
I am leaving an empty password (by pressing enter) (or should I be explicitly typing "Empty"?)
Step 3: when I enter the chroot and try to run 'root@localhost ls', it prompts me to add localhost to the list of known hosts, but then asks for a password. If I try a blank password it gives me permission denied errors.
If I run system exec from LabVIEW I get a return of permission denied x3.
I am using a Raspberry Pi 5 with Hobbyist/LINX RT 25.1.0-1
I feel like I am missing something pretty simple here.
Has anyone managed to get this trick working on Pi5?
Below is an output of steps 2+3 from the terminal.
Linux raspberrypi 6.12.25+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.12.25-1+rpt1 (2025-04-30) aarch64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu Jun 19 09:17:49 2025 from 192.168.1.197
pi@raspberrypi:~ $ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/pi/.ssh/id_rsa):
/home/pi/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/pi/.ssh/id_rsa
Your public key has been saved in /home/pi/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:fkqzSHO46ZRUHKHBkIH0s9DfZMacVXUUVekffIJWI9A pi@raspberrypi
The key's randomart image is:
+---[RSA 3072]----+
| ...o=. o.o+...oX|
| .o. .* + E oo |
| . + . X +o. |
| . + * o .+.|
| . o S . .+|
| . + .|
| * = . |
| o B = |
| .= o |
+----[SHA256]-----+
pi@raspberrypi:~ $ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
pi@raspberrypi:~ $ sudo mkdir /srv/chroot/labview/root/.ssh
pi@raspberrypi:~ $ sudo cp ~/.ssh/id_rsa* /srv/chroot/labview/root/.ssh/.
pi@raspberrypi:~ $ sudo schroot -r -c lv
root@raspberrypi:/home/pi# ssh root@localhost ls
The authenticity of host 'localhost (127.0.0.1)' can't be established.
ECDSA key fingerprint is 86:52:43:93:5b:ed:17:8f:0f:35:e8:42:6b:36:26:1b.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
root@localhost's password:
Permission denied, please try again.
root@localhost's password:
Permission denied, please try again.
root@localhost's password:
Permission denied (publickey,password).
root@raspberrypi:/home/pi# exit
logout
pi@raspberrypi:~ $ sudo schroot -r -c lv
root@raspberrypi:/home/pi# ssh pi@localhost cat /etc/debian_version.
pi@localhost's password:
Kind Regards,
Rob