<div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Thu, Nov 29, 2018 at 12:35 PM Daniel Kasak <<a href="mailto:d.j.kasak.dk@gmail.com">d.j.kasak.dk@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi all. I'm using Net::OpenSSH, which shells out to ssh ( yeah I know, not ideal ). Anyway, if I launch my app 'normally' ( flatpak run <app_name> ), when I try to open an ssh connection, I get:<div><br></div><div>Can't exec "ssh": No such file or directory at /app/lib/perl5/site_perl/5.24.1/Net/OpenSSH.pm line 978.<br></div><div><br></div><div>But when I run it from a debugging session:</div><div><br></div><div>flatpak run -d --command=bash <app_name><br></div><div><br></div><div> ... it works fine. ssh is installed to /usr/bin/ssh in the container ( and I didn't build it ... maybe it's part of the runtime ), and I guess that's *not* in my path 'normally', but it *is* in my path in a debug session. Why is that?</div></div></div></div></blockquote><div><br></div><div>Update. It turns out /usr/bin/ssh doesn't even exist when I run normally, so that explains things somewhat. So I've added openssh to my app. It appeared to build:</div><div><br></div><div><div>make[1]: Entering directory '/run/build/openssh/openbsd-compat'</div><div>make[1]: Nothing to be done for 'all'.</div><div>make[1]: Leaving directory '/run/build/openssh/openbsd-compat'</div><div>/usr/bin/mkdir -p /app/bin</div><div>/usr/bin/mkdir -p /app/sbin</div><div>/usr/bin/mkdir -p /app/share/man/man1</div><div>/usr/bin/mkdir -p /app/share/man/man5</div><div>/usr/bin/mkdir -p /app/share/man/man8</div><div>/usr/bin/mkdir -p /app/libexec</div><div>/usr/bin/mkdir -p -m 0755 /var/empty</div><div>/usr/bin/install -c -m 0755 -s ssh /app/bin/ssh</div><div>/usr/bin/install -c -m 0755 -s scp /app/bin/scp</div><div>/usr/bin/install -c -m 0755 -s ssh-add /app/bin/ssh-add</div><div>/usr/bin/install -c -m 0755 -s ssh-agent /app/bin/ssh-agent</div><div>/usr/bin/install -c -m 0755 -s ssh-keygen /app/bin/ssh-keygen</div><div>/usr/bin/install -c -m 0755 -s ssh-keyscan /app/bin/ssh-keyscan</div><div>/usr/bin/install -c -m 0755 -s sshd /app/sbin/sshd</div><div>/usr/bin/install -c -m 4711 -s ssh-keysign /app/libexec/ssh-keysign</div><div>/usr/bin/install -c -m 0755 -s ssh-pkcs11-helper /app/libexec/ssh-pkcs11-helper</div><div>/usr/bin/install -c -m 0755 -s sftp /app/bin/sftp</div><div>/usr/bin/install -c -m 0755 -s sftp-server /app/libexec/sftp-server</div><div>/usr/bin/install -c -m 644 ssh.1.out /app/share/man/man1/ssh.1</div><div>/usr/bin/install -c -m 644 scp.1.out /app/share/man/man1/scp.1</div><div>/usr/bin/install -c -m 644 ssh-add.1.out /app/share/man/man1/ssh-add.1</div><div>/usr/bin/install -c -m 644 ssh-agent.1.out /app/share/man/man1/ssh-agent.1</div><div>/usr/bin/install -c -m 644 ssh-keygen.1.out /app/share/man/man1/ssh-keygen.1</div><div>/usr/bin/install -c -m 644 ssh-keyscan.1.out /app/share/man/man1/ssh-keyscan.1</div><div>/usr/bin/install -c -m 644 moduli.5.out /app/share/man/man5/moduli.5</div><div>/usr/bin/install -c -m 644 sshd_config.5.out /app/share/man/man5/sshd_config.5</div><div>/usr/bin/install -c -m 644 ssh_config.5.out /app/share/man/man5/ssh_config.5</div><div>/usr/bin/install -c -m 644 sshd.8.out /app/share/man/man8/sshd.8</div><div>/usr/bin/install -c -m 644 sftp.1.out /app/share/man/man1/sftp.1</div><div>/usr/bin/install -c -m 644 sftp-server.8.out /app/share/man/man8/sftp-server.8</div><div>/usr/bin/install -c -m 644 ssh-keysign.8.out /app/share/man/man8/ssh-keysign.8</div><div>/usr/bin/install -c -m 644 ssh-pkcs11-helper.8.out /app/share/man/man8/ssh-pkcs11-helper.8</div><div>/usr/bin/mkdir -p /app/etc</div><div>ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519</div><div>/app/sbin/sshd -t -f /app/etc/sshd_config</div><div>Committing stage build-openssh to cache</div></div><div><br></div><div>So there's the line:</div><div>/usr/bin/install -c -m 0755 -s ssh /app/bin/ssh<br></div><div><br></div><div>But /app/bin/ssh didn't end up in my final image:</div><div><br></div><div><div>bash-4.4$ cd /app/</div><div>bash-4.4$ find . | grep ssh</div><div>./etc/ssh_config</div><div>./etc/ssh_host_dsa_key</div><div>./etc/ssh_host_dsa_key.pub</div><div>./etc/ssh_host_ecdsa_key</div><div>./etc/ssh_host_ecdsa_key.pub</div><div>./etc/ssh_host_ed25519_key</div><div>./etc/ssh_host_ed25519_key.pub</div><div>./etc/ssh_host_rsa_key</div><div>./etc/ssh_host_rsa_key.pub</div><div>./etc/sshd_config</div><div>./libexec/ssh-keysign</div><div>./libexec/ssh-pkcs11-helper</div><div>./sbin/sshd</div></div><div><br></div><div>Anyone know why?</div><div><br></div><div>Dan</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
</blockquote></div></div></div></div>