Hobbyist Toolkit

cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Chroot Trick on Raspberry Pi 5

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 

RobMaywick_0-1750322771697.png

 

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

0 Kudos
Message 1 of 5
(632 Views)

Hi, Rob

I have the same issue with Chroot Trick on Raspberry pi 5.

Have you found a solution?

 

Best regards

Alex

 

0 Kudos
Message 2 of 5
(316 Views)

Hi Alex, 

I did manage to find a workaround. I think it was to do with RSA keygen not being compatible. The general overview I followed was: 


SSH into the PI and chroot into the LV directory.

might need to install ssh-keygen 

Generate an ECDSA keygen instead of RSA. 

Exit the chroot. 

Copy the public key to the .ssh location in the main pi user and add it to the authorized keys 

 

I will get around to writing a more in-depth command list when I have a bit more time and a fresh PI to make sure I get it fully correct.  

 

Rob

0 Kudos
Message 3 of 5
(261 Views)

Hi Rob,

I've tried it. Your method really works. Thank you so much! I don't know how to express my appreciation!

 

Best regards

Alex

0 Kudos
Message 4 of 5
(246 Views)

Rob,

 

Thanks, and I look forward to your in-depth response as I'm new at Linux/RPi.

 

0 Kudos
Message 5 of 5
(105 Views)