This commit is contained in:
Iwan Clément
2019-05-16 14:36:46 +02:00
2 changed files with 6 additions and 4 deletions

View File

@@ -38,10 +38,12 @@ mkdir /home/$USERNAME/.ssh \
&& chown -R $USERNAME:$USERNAME /home/$USERNAME \ && chown -R $USERNAME:$USERNAME /home/$USERNAME \
|| exit 3 || exit 3
if [ -e $DEBFLAG ]; then
if [ -d /var/lib/AccountsService/users ]; then if [ -d /var/lib/AccountsService/users ]; then
echo "[User]">/var/lib/AccountsService/users/$USERNAME echo "[User]">/var/lib/AccountsService/users/$USERNAME
echo "SystemAccount=true">>/var/lib/AccountsService/users/$USERNAME echo "SystemAccount=true">>/var/lib/AccountsService/users/$USERNAME
fi fi
fi
if [ -e $DEBFLAG ]; then if [ -e $DEBFLAG ]; then
systemctl enable ssh && systemctl restart ssh && exit 0 systemctl enable ssh && systemctl restart ssh && exit 0

View File

@@ -5,7 +5,7 @@ After=network.target
[Service] [Service]
User={{ANS_REMOTE_USER}} User={{ANS_REMOTE_USER}}
ExecStartPre=cd /home/{{ANS_REMOTE_USER}} #ExecStartPre=cd /home/{{ANS_REMOTE_USER}}
EnvironmentFile=/etc/default/secure-tunnel EnvironmentFile=/etc/default/secure-tunnel
ExecStart=/usr/bin/ssh -p ${REMOTE_PORT} -NT -i /home/{{ANS_REMOTE_USER}}/.ssh/{{KEY_NAME}} -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -R ${RTARGET_PORT}:localhost:22 ${ANS_TARGET_USER}@${TARGET} ExecStart=/usr/bin/ssh -p ${REMOTE_PORT} -NT -i /home/{{ANS_REMOTE_USER}}/.ssh/{{KEY_NAME}} -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -R ${RTARGET_PORT}:localhost:22 ${ANS_TARGET_USER}@${TARGET}