diff options
Diffstat (limited to 'rapid-tunneling')
-rwxr-xr-x | rapid-tunneling | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rapid-tunneling b/rapid-tunneling index 4949447..1528e2e 100755 --- a/rapid-tunneling +++ b/rapid-tunneling @@ -21,12 +21,12 @@ cp $tmpdir/recv/key $HOME/key tar czf $HOME/ra-params.tar.gz -C $tmpdir/send key origkey mkdir -p -m 700 $HOME/.ssh -awk '$NF != "rapid-tunneling" {print}' $HOME/.ssh/authorized_keys > $HOME/.ssh/authorized_keys.new 2>/dev/null +awk '$NF != "rapid-tunneling" {print}' $HOME/.ssh/authorized_keys > $HOME/.ssh/authorized_keys.new 2>/dev/null || true cat $tmpdir/send/key.pub >> $HOME/.ssh/authorized_keys.new mv -f $HOME/.ssh/authorized_keys.new $HOME/.ssh/authorized_keys chmod 644 $HOME/.ssh/authorized_keys rm -rf $tmpdir # Remove host key of $host (in case it has changed) -ssh-keygen -R $host +ssh-keygen -R $host 2>/dev/null || true # Run in background busybox start-stop-daemon -S -b -m -p $HOME/pid -x /bin/sh -- -c "exec ssh -o 'StrictHostKeyChecking no' -o 'BatchMode yes' -o 'ServerAliveInterval 60' -T -p $port -i $HOME/key -R $tunnelport:127.0.0.1:22 -l $user $host < $HOME/ra-params.tar.gz" |