diff --git a/src/frontend/mosh-server.cc b/src/frontend/mosh-server.cc index e8a6cb70f..35aa7f5c5 100644 --- a/src/frontend/mosh-server.cc +++ b/src/frontend/mosh-server.cc @@ -570,6 +570,12 @@ static int run_server( const char *desired_ip, const char *desired_port, exit( 1 ); } + /* clear stale SSH_TTY environment variable */ + if ( unsetenv( "SSH_TTY" ) < 0 ) { + perror( "unsetenv" ); + exit( 1 ); + } + chdir_homedir(); if ( with_motd && (!motd_hushed()) ) {