Skip to content

Commit

Permalink
add ssh-mosh wrapper for gcloud compute ssh
Browse files Browse the repository at this point in the history
google-cloud-sdk/lib/googlecloudsdk/command_lib/util/ssh/ssh.py

I have changed it from ssh to ssh-mosh invoke itnwith

gcloud compute ssh a@u -- -XC

I have a twenty four hours layover in Shanghai Pudong and need to connect to a Microsoft server in Korea IPsec server is a night mare to configure literally was disconnected a hundred times before I did this in desperation still doesn't work

a complete side note you have to get Reddit to unblock Microsoft because Chinese people desperately need Reddit and Microsoft is the only thing their government has not blocked because they use it themselves thanks
  • Loading branch information
john-peterson committed Feb 4, 2025
1 parent 1105d48 commit 7fcb76c
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions scripts/ssh-mosh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/env bash
# echo ssh-mosh $*

val=()
pos=()
while [[ $# -gt 0 ]]; do
case $1 in
-i|-p|-o)
val+=("$1 $2")
shift 2
;;
-X*|-C*|-v*)
val+=("$1")
shift
;;
-*|--*)
echo skipping $1
shift
;;
*)
pos+=("$1")
shift;;
esac
done

echo installing mosh-server
ssh -o LogLevel=quiet ${val[*]} -- ${pos[0]} "sudo apt-get -qq update; sudo apt-get -qqy install mosh"

# echo mosh --ssh "ssh ${val[*]}" -- ${pos[*]}
mosh --no-init --ssh "ssh ${val[*]}" -- ${pos[*]}

0 comments on commit 7fcb76c

Please sign in to comment.