Fix agent forwarding for mosh

This commit is contained in:
2026-07-08 17:10:40 +02:00
parent eabc84c914
commit 397a5c8fc3
+3 -2
View File
@@ -170,8 +170,9 @@ osh() {
local DEST="$1"
# TODO: loop to re-establish connection in case of network drop.
# Kill the loop after mosh (below) finishes.
ssh -O check "$DEST" 2>/dev/null || ssh -A -f -N -o ControlPersist=yes "$DEST"
mosh "$@"
ssh -O check "$DEST" 2>/dev/null || ssh -A -f -o ControlPersist=yes "$DEST" "sleep 2592000"
# Disable agent forwarding on the bootstrap connection to prevent it from overwriting the symlink in .ssh/rc
mosh --ssh="ssh -a" "$@"
}
alias backup-home-explore='eval "ncdu $(grep -A1 -- --exclude $HOME/bin/backup-home | tr -d \|)"'