3

I can see that several questions have been asked and answered regarding the error message stdin: is not a TTY with regards to SSH terminal connections between machines. However, I am using X2goserver and client to connect a Fedora 22 based client to a server (currently testing Ubuntu 14.04, but have used others too) and am seeing the same error after connecting.

I have looked in the SSH config file and made changes related to TTY and interactive consoles that looked like they might help the situation, but they didn't. i have also now raised a bug with the x2go dev team, plus asked on the Ubuntu forum but so far have not had a reply.

I think X2go is intended to take care of ensuring the correct params are passed to ensure a session is created that offers the appropriate functions for opening a GUI for the remote machine, so i am thinking this might be a bug with X2go - however, the lack of others complaining of the same issue makes me think otherwise.

For reference, I am using templates on an OpenVZ based remote server and have had X2go running just fine there with Fedora 20 and XFCE - but i need to upgrade now as fedora 20 is no longer being supported.

thanks

Jakuje
  • 20,974
  • 7
  • 51
  • 70
tunist
  • 31
  • 1
  • 4

1 Answers1

2

I had this yesterday and this morning as well. I found the problem.

As part of the establishment of a session, x2go appears to be executing both .bashrc and .bash_profile to completion BEFORE actually presenting the session. I found that .bash_profile was executing mesg y as well as another shell script that attempted to use the value returned from tty as a variable (ie TTY=`tty`). Since these statements are not being executed from within a terminal they failed. The solution is to place them inside a test as follows:

if `tty -s`
then
    mesg y
    TTY=`tty`
else`
    TTY='not a tty'
fi

This fixed it on all sites I could not connect to. I suspect a recent change in x2go may have brought this into focus as these sites had not changed since my last successful x2go connections.

roaima
  • 107,089
  • 14
  • 139
  • 261
  • You can also `if test -t 0` to avoid the call-out to `tty` itself. And ``TTY=`tty 2>&1` `` would allow `TTY` to be set outside the conditional. – roaima Apr 15 '16 at 13:40
  • Or you can set `TTY` as part of the condition and simplify the entire chunk of code to a single line: ``TTY=`tty` && mesg y` `` – roaima Apr 15 '16 at 13:44
  • actually it can be in ~/.profile as well – Kai May 05 '18 at 18:13