Path issue

Daniel Kasak d.j.kasak.dk at gmail.com
Thu Nov 29 04:12:48 UTC 2018


On Thu, Nov 29, 2018 at 12:35 PM Daniel Kasak <d.j.kasak.dk at gmail.com>
wrote:

> 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:
>
> Can't exec "ssh": No such file or directory at
> /app/lib/perl5/site_perl/5.24.1/Net/OpenSSH.pm line 978.
>
> But when I run it from a debugging session:
>
> flatpak run -d --command=bash <app_name>
>
>  ... 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?
>

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:

make[1]: Entering directory '/run/build/openssh/openbsd-compat'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/run/build/openssh/openbsd-compat'
/usr/bin/mkdir -p /app/bin
/usr/bin/mkdir -p /app/sbin
/usr/bin/mkdir -p /app/share/man/man1
/usr/bin/mkdir -p /app/share/man/man5
/usr/bin/mkdir -p /app/share/man/man8
/usr/bin/mkdir -p /app/libexec
/usr/bin/mkdir -p -m 0755 /var/empty
/usr/bin/install -c -m 0755 -s ssh /app/bin/ssh
/usr/bin/install -c -m 0755 -s scp /app/bin/scp
/usr/bin/install -c -m 0755 -s ssh-add /app/bin/ssh-add
/usr/bin/install -c -m 0755 -s ssh-agent /app/bin/ssh-agent
/usr/bin/install -c -m 0755 -s ssh-keygen /app/bin/ssh-keygen
/usr/bin/install -c -m 0755 -s ssh-keyscan /app/bin/ssh-keyscan
/usr/bin/install -c -m 0755 -s sshd /app/sbin/sshd
/usr/bin/install -c -m 4711 -s ssh-keysign /app/libexec/ssh-keysign
/usr/bin/install -c -m 0755 -s ssh-pkcs11-helper
/app/libexec/ssh-pkcs11-helper
/usr/bin/install -c -m 0755 -s sftp /app/bin/sftp
/usr/bin/install -c -m 0755 -s sftp-server /app/libexec/sftp-server
/usr/bin/install -c -m 644 ssh.1.out /app/share/man/man1/ssh.1
/usr/bin/install -c -m 644 scp.1.out /app/share/man/man1/scp.1
/usr/bin/install -c -m 644 ssh-add.1.out /app/share/man/man1/ssh-add.1
/usr/bin/install -c -m 644 ssh-agent.1.out /app/share/man/man1/ssh-agent.1
/usr/bin/install -c -m 644 ssh-keygen.1.out /app/share/man/man1/ssh-keygen.1
/usr/bin/install -c -m 644 ssh-keyscan.1.out
/app/share/man/man1/ssh-keyscan.1
/usr/bin/install -c -m 644 moduli.5.out /app/share/man/man5/moduli.5
/usr/bin/install -c -m 644 sshd_config.5.out
/app/share/man/man5/sshd_config.5
/usr/bin/install -c -m 644 ssh_config.5.out /app/share/man/man5/ssh_config.5
/usr/bin/install -c -m 644 sshd.8.out /app/share/man/man8/sshd.8
/usr/bin/install -c -m 644 sftp.1.out /app/share/man/man1/sftp.1
/usr/bin/install -c -m 644 sftp-server.8.out
/app/share/man/man8/sftp-server.8
/usr/bin/install -c -m 644 ssh-keysign.8.out
/app/share/man/man8/ssh-keysign.8
/usr/bin/install -c -m 644 ssh-pkcs11-helper.8.out
/app/share/man/man8/ssh-pkcs11-helper.8
/usr/bin/mkdir -p /app/etc
ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519
/app/sbin/sshd -t -f /app/etc/sshd_config
Committing stage build-openssh to cache

So there's the line:
/usr/bin/install -c -m 0755 -s ssh /app/bin/ssh

But /app/bin/ssh didn't end up in my final image:

bash-4.4$ cd /app/
bash-4.4$ find . | grep ssh
./etc/ssh_config
./etc/ssh_host_dsa_key
./etc/ssh_host_dsa_key.pub
./etc/ssh_host_ecdsa_key
./etc/ssh_host_ecdsa_key.pub
./etc/ssh_host_ed25519_key
./etc/ssh_host_ed25519_key.pub
./etc/ssh_host_rsa_key
./etc/ssh_host_rsa_key.pub
./etc/sshd_config
./libexec/ssh-keysign
./libexec/ssh-pkcs11-helper
./sbin/sshd

Anyone know why?

Dan

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/flatpak/attachments/20181129/792c09f4/attachment.html>


More information about the Flatpak mailing list