[mosh-users] How to determine if running inside mosh-server? (plus remainders of the initial SSH connection)
Axel Beckert
abe at deuxchevaux.org
Wed Apr 11 06:13:11 EDT 2012
Hi,
is there a way to recognize that a program or shell is running inside
mosh(-server)? I mean besides running "ps xf" and parsing the output.
:-)
Acutally I imagine something like SSH's environment variables…
… which are btw. still present on processes started by mosh:
~ → echo $$
18755
~ → ps xf | fgrep -v grep | fgrep -A1 mosh
18754 ? S 0:02 mosh-server new -s -c 256
18755 pts/17 Ss 0:01 \_ -/usr/bin/zsh
~ → tty
/dev/pts/17
~ → env | fgrep SSH
SSH_CLIENT=192.xx.yy.zz 50116 22
SSH_CONNECTION=192.xx.yy.zz 50116 178.aa.bb.cc 22
SSH_TTY=/dev/pts/16
SSH_AUTH_SOCK=/tmp/ssh-lPVun18751/agent.18751
Note also the different tty in $SHH_TTY and the "tty" and "ps xf"
output.
Shouldn't mosh-server drop all $SSH_* variables before spawning a
shell (or some other program)? And maybe export some $MOSH_… :-)
Kind regards, Axel
--
/~\ Plain Text Ribbon Campaign | Axel Beckert
\ / Say No to HTML in E-Mail and News | abe at deuxchevaux.org (Mail)
X See http://www.asciiribbon.org/ | abe at noone.org (Mail+Jabber)
/ \ I love long mails: http://email.is-not-s.ms/ | http://noone.org/abe/ (Web)
More information about the mosh-users
mailing list