forked from DGNum/liminix
set PATH correctly in ssh sessions
for a non=interactive shell ("ssh linminix foo") ash does not source *any* startup files, so we need to set this to something more useful than /bin:usr/bin
This commit is contained in:
parent
a48d51ffdc
commit
0173a9ced9
1 changed files with 10 additions and 1 deletions
|
@ -151,12 +151,21 @@ in rec {
|
||||||
|
|
||||||
services.sshd = longrun {
|
services.sshd = longrun {
|
||||||
name = "sshd";
|
name = "sshd";
|
||||||
|
# env -i clears the environment so we don't pass anything weird to
|
||||||
|
# ssh sessions. Dropbear params are
|
||||||
|
# -e pass environment to child
|
||||||
|
# -E log to stderr
|
||||||
|
# -R create hostkeys if needed
|
||||||
|
# -P pid-file
|
||||||
|
# -F don't fork into background
|
||||||
|
|
||||||
run = ''
|
run = ''
|
||||||
if test -d /persist; then
|
if test -d /persist; then
|
||||||
mkdir -p /persist/secrets/dropbear
|
mkdir -p /persist/secrets/dropbear
|
||||||
ln -s /persist/secrets/dropbear /run
|
ln -s /persist/secrets/dropbear /run
|
||||||
fi
|
fi
|
||||||
${dropbear}/bin/dropbear -E -R -P /run/dropbear.pid -F
|
PATH=${lib.makeBinPath config.defaultProfile.packages}:/bin
|
||||||
|
exec env -i ENV=/etc/ashrc PATH=$PATH ${dropbear}/bin/dropbear -e -E -R -P /run/dropbear.pid -F
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue