fsquillace / junest

The lightweight Arch Linux based distro that runs, without root privileges, on top of any other Linux distro.
GNU General Public License v3.0
2.1k stars 110 forks source link

How do make junest programs use the SSH command of the host? #361

Open NightMachinery opened 11 hours ago

NightMachinery commented 11 hours ago

I have installed emacs using junest. When I want to push my git repos, if I don't install:

pacman -Syy --noconfirm openssh

I'll get this error:

error: cannot run ssh: No such file or directory
fatal: unable to fork

When installing OpenSSH using the pacman command above, I get lots of errors, but it seems the installation succeeds anyway:

:: Running post-transaction hooks...
(1/4) Reloading system manager configuration...
Failed to check for chroot() environment: Permission denied
  Skipped: Current root is not booted.
(2/4) Reloading user manager configuration...
Failed to check for chroot() environment: Permission denied
  Skipped: Current root is not booted.
(3/4) Creating temporary files...
/usr/lib/tmpfiles.d/dbus.conf:13: Failed to resolve user 'dbus': No such process
/usr/lib/tmpfiles.d/shadow.conf:1: Failed to resolve group 'groups': No such process
Failed to parse ACL "d:group::r-x,d:group:adm:r-x,d:group:wheel:r-x,group::r-x,group:adm:r-x,group:wheel:r-x", ignoring: No such file or directory
Failed to parse ACL "d:group:adm:r-x,d:group:wheel:r-x,group:adm:r-x,group:wheel:r-x", ignoring: No such file or directory
Failed to parse ACL "group:adm:r--,group:wheel:r--", ignoring: No such file or directory
Failed to parse ACL "d:group::r-x,d:group:adm:r-x,d:group:wheel:r-x,group::r-x,group:adm:r-x,group:wheel:r-x", ignoring: No such file or directory
Failed to parse ACL "d:group:adm:r-x,d:group:wheel:r-x,group:adm:r-x,group:wheel:r-x", ignoring: No such file or directory
Failed to parse ACL "group:adm:r--,group:wheel:r--", ignoring: No such file or directory
error: command failed to execute correctly
(4/4) Arming ConditionNeedsUpdate...

But the junest SSH cannot use my public keys in ~/.ssh, so it cannot access my Github repos. How do I solve this problem? I see two solutions:

  1. Somehow make emacs use the host SSH command.
  2. Copy my private/public keys somewhere that the junest-installed SSH can find them.
NightMachinery commented 11 hours ago

I tried doing this:

d="${HOME}/.junest/home/$(whoami)/.ssh"

cp -r ~/.ssh "${d:h}"
chmod 700 "${d}"
chmod 600 "${d}"/*(.DN)

But I get this error:

❯ /home/tmptilmay/.junest/usr/bin_wrappers/ssh git@github.com
Bad owner or permissions on /home/tmptilmay/.ssh/config

❯ ls -l /home/tmptilmay/.ssh/config
-rw-rw-r-- 1 tmptilmay tmptilmay 191 Oct  1 17:19 /home/tmptilmay/.ssh/config