Hi,
we just tried to x2go for the first time (client 4.0.5.2 server 4.0.1 on SLED 12). It works fine for users with bash as login shell on the server side, but fails for those with tcsh.
According to http://blog.x2go.org/index.php/2012/07/26/x2go-sessions-startups-for-users-w... this should have been fixed a while ago, but it seems to have returned.
I couldn't see any difference neither in the server log (debug level) nor in the output of "x2goclient --debug". The clients are identical until the line
x2go-DEBUG-../src/onmainwindow.cpp:6014> Proxy wrote on stderr: "Session: Session started at 'Fri Oct 6 16:43:09 2017'.
and then the tcsh instance exits with Warning: Protocol mismatch or no X authentication data.
while the bash version continues with x2go-DEBUG-../src/onmainwindow.cpp:6014> Proxy wrote on stderr: "Info: Established X server connection.
The server logs are identical until the line 2017-10-06T16:43:09.173981+02:00 knuth /usr/lib/x2go/x2gocreatesession[21667]: db_createsession called, session ID: fst-76-1507300986_stDmwm_dp24, cookie: 7b94de4d7f6bdbcda01a3dc547c42f66, client: xx:xx:xx:xx, pid: 21620, graphics port: 35760, sound port: 35761, file sharing port: 35762
and then the tcsh instance exits with 2017-10-06T16:43:15.007175+02:00 knuth sshd[21228]: pam_unix(sshd:session): session closed for user fst 2017-10-06T16:43:15.011998+02:00 knuth systemd-logind[9940]: Removed session 59.
Is this problem known already? Sth. I could try to solve it? We wouldn't like to force all our users to switch away from their tcsh...
cu, Frank
-- Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/ Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/ LMU, Amalienstr. 17 Phone: +49 89 2180-4049 80333 Muenchen, Germany Fax: +49 89 2180-99-4049
HI Frank,
I sent a message about something similar a short while ago: http://lists.x2go.org/pipermail/x2go-user/2017-September/004539.html . Unfortunately, I didn't receive any responses.
Thanks for pointing out the article from 2012; I was not aware of it.
In our particular case, I think the workaround was to remove the bash-related dotfiles from the user's home directory and/or to modify the PATH in $HOME/.bash* . But this is not an easily generalized solution. I suppose we could have tried modifying the x2go run script in some way, but I haven't gone down that road yet.
-- Marlin
On Sat, Oct 7, 2017 at 7:07 AM, Frank Steiner <fsteiner-mail1@bio.ifi.lmu.de
wrote:
Hi,
we just tried to x2go for the first time (client 4.0.5.2 server 4.0.1 on SLED 12). It works fine for users with bash as login shell on the server side, but fails for those with tcsh.
According to http://blog.x2go.org/index.php/2012/07/26/x2go-sessions-star tups-for-users-with-non-bash-like-shells-e-g-tcsh-and-alike/ this should have been fixed a while ago, but it seems to have returned.
I couldn't see any difference neither in the server log (debug level) nor in the output of "x2goclient --debug". The clients are identical until the line
x2go-DEBUG-../src/onmainwindow.cpp:6014> Proxy wrote on stderr: "Session: Session started at 'Fri Oct 6 16:43:09 2017'.
and then the tcsh instance exits with Warning: Protocol mismatch or no X authentication data.
while the bash version continues with x2go-DEBUG-../src/onmainwindow.cpp:6014> Proxy wrote on stderr: "Info: Established X server connection.
The server logs are identical until the line 2017-10-06T16:43:09.173981+02:00 knuth /usr/lib/x2go/x2gocreatesession[21667]: db_createsession called, session ID: fst-76-1507300986_stDmwm_dp24, cookie: 7b94de4d7f6bdbcda01a3dc547c42f66, client: xx:xx:xx:xx, pid: 21620, graphics port: 35760, sound port: 35761, file sharing port: 35762
and then the tcsh instance exits with 2017-10-06T16:43:15.007175+02:00 knuth sshd[21228]: pam_unix(sshd:session): session closed for user fst 2017-10-06T16:43:15.011998+02:00 knuth systemd-logind[9940]: Removed session 59.
Is this problem known already? Sth. I could try to solve it? We wouldn't like to force all our users to switch away from their tcsh...
cu, Frank
-- Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/ Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/ LMU, Amalienstr. 17 Phone: +49 89 2180-4049 80333 Muenchen, Germany Fax: +49 89 2180-99-4049
- Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. *
x2go-user mailing list x2go-user@lists.x2go.org https://lists.x2go.org/listinfo/x2go-user
On 10/07/2017 01:07 PM, Frank Steiner wrote:
we just tried to x2go for the first time (client 4.0.5.2 server 4.0.1 on SLED 12). It works fine for users with bash as login shell on the server side, but fails for those with tcsh.
4.0.5.2 is quite old by now. This said, the change that explicitly calls bash on session startup came in with 4.0.5.0 (which used "sh" previously) and was updated to use bash as login shell explicitly was part of 4.0.5.1, so 4.0.5.2 should be able to handle that situation.
According to http://blog.x2go.org/index.php/2012/07/26/x2go-sessions-startups-for-users-w... this should have been fixed a while ago, but it seems to have returned.
The mentioned change is very old and relied on executing "sh". We've seen users changing this to non-bash compatible shells in the past, so it didn't fix all issues.
I couldn't see any difference neither in the server log (debug level) nor in the output of "x2goclient --debug". The clients are identical until the line
x2go-DEBUG-../src/onmainwindow.cpp:6014> Proxy wrote on stderr: "Session: Session started at 'Fri Oct 6 16:43:09 2017'.
and then the tcsh instance exits with Warning: Protocol mismatch or no X authentication data.
while the bash version continues with x2go-DEBUG-../src/onmainwindow.cpp:6014> Proxy wrote on stderr: "Info: Established X server connection.
The server logs are identical until the line 2017-10-06T16:43:09.173981+02:00 knuth /usr/lib/x2go/x2gocreatesession[21667]: db_createsession called, session ID: fst-76-1507300986_stDmwm_dp24, cookie: 7b94de4d7f6bdbcda01a3dc547c42f66, client: xx:xx:xx:xx, pid: 21620, graphics port: 35760, sound port: 35761, file sharing port: 35762
and then the tcsh instance exits with 2017-10-06T16:43:15.007175+02:00 knuth sshd[21228]: pam_unix(sshd:session): session closed for user fst 2017-10-06T16:43:15.011998+02:00 knuth systemd-logind[9940]: Removed session 59.
Yeah, because nxagent died or wasn't started correctly, so the session terminates.
Is this problem known already? Sth. I could try to solve it? We wouldn't like to force all our users to switch away from their tcsh...
No, but I guess I know what the problem is. Quoting in bash and tcsh is different (esp. nested double quotes, which don't work by default in tcsh but is a special option), so some (or all) commands might not be getting executed correctly.
I guess we'll need a more sophisticated approach that executes bash directly once and then uses a bash instance to parse the command line instead of letting the user's default shell handle parsing the initial command.
Sorry, I can't offer a workaround. It's just buggy currently.
Mihai
Mihai Moldovan wrote
4.0.5.2 is quite old by now. This said, the change that explicitly calls bash on
I see, but that was the latest version the opensuse build repositories offer. I'll try to compile form source.
No, but I guess I know what the problem is. Quoting in bash and tcsh is different (esp. nested double quotes, which don't work by default in tcsh but is a special option), so some (or all) commands might not be getting executed correctly.
Ok, I understand that. Getting quoting right for different shells is more than complicated...
I guess we'll need a more sophisticated approach that executes bash directly once and then uses a bash instance to parse the command line instead of letting the user's default shell handle parsing the initial command.
We had similiar problems in configuring a host with a bunch of ssh commands. Our solution was to create a bash script with all the neccessary code on the client side on the fly, copy it over to the target host and execute it there. Could that be solution here?
cu, Frank
-- Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/ Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/ LMU, Amalienstr. 17 Phone: +49 89 2180-4049 80333 Muenchen, Germany Fax: +49 89 2180-99-4049
On 10/08/2017 12:31 AM, Frank Steiner wrote:
I see, but that was the latest version the opensuse build repositories offer. I'll try to compile form source.
Typically more recent versions are available from our repository, that is automatically populated with release and nightly builds - but you shouldn't mix OBS packages with our repository. More information, as always, on the wiki: https://wiki.x2go.org/doku.php/wiki:repositories:suse
Ok, I understand that. Getting quoting right for different shells is more than complicated...
Yeah, but I don't even want to get it right. I'd rather spawn bash and let it do the parsing, since that's providing the behavior we actually expect and use currently.
We had similiar problems in configuring a host with a bunch of ssh commands. Our solution was to create a bash script with all the neccessary code on the client side on the fly, copy it over to the target host and execute it there. Could that be solution here?
I've been thinking about this, yeah. I'd generally like to avoid writing temporary files and pushing them to the server for every command that the client executes, but unless I can come up with a better solution I'll probably have to go with that. As always, no ETA on that, though. Might take quite some time to get this done.
Mihai
Hi,
I was able to solve this. When I looked into the code, I saw that you already to use "bash -c '...'" for all commands, so quoting shouldn't be an issue.
But as the error message for tcsh was about Warning: Protocol mismatch or no X authentication data. I started looking at xauth and found an interesting difference between bash and tcsh as login shell.
For bash, these entries are added by x2gostartagent:
myhost/unix:59 MIT-MAGIC-COOKIE-1 e938deb788659f0bf8c99069d199aff6 myhost.ifi.lmu.de:59 MIT-MAGIC-COOKIE-1 e938deb788659f0bf8c99069d199aff6 myhost.ifi.lmu.de:59 MIT-MAGIC-COOKIE-1 e938deb788659f0bf8c99069d199aff6
For tcsh, I got those: myhost.ifi.lmu.de/unix:58 MIT-MAGIC-COOKIE-1 7212fb8aa466de75ea0224a4d010f5e4 myhost.ifi.lmu.de:58 MIT-MAGIC-COOKIE-1 7212fb8aa466de75ea0224a4d010f5e4 myhost.ifi.lmu.de:58 MIT-MAGIC-COOKIE-1 7212fb8aa466de75ea0224a4d010f5e4
And that's the point! For some reason, x2go needs the cookie for display "myhost/unix" at some point and "myhost.ifi.lmu.de/unix" doesn't suffice.
Indeed, when I wrote a little bash script
#!/bin/bash echo $HOSTNAME
and called it with "ssh myhost bash -c './testscript'", it echoed "myhost" with login shell bash, and "myhost.ifi.lmu.de" with login shell tcsh.
I'm not yet sure where this difference comes from, if it's deep inside bash and tcsh or in some server-wide login scripts from SuSE (it was not in the users dotfiles, we even removed them all).
Anwyay, I added "setenv HOSTNAME uname -n
" to my .cshrc and:
x2go works :-)
To make that work for all our users I added HOSTNAME=${HOSTNAME%%.*} into x2gostartagent which doesn't harm if HOSTNAME is already without the domain. So maybe you could add this to the next release to help people running into the same issue.
cu, Frank
-- Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/ Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/ LMU, Amalienstr. 17 Phone: +49 89 2180-4049 80333 Muenchen, Germany Fax: +49 89 2180-99-4049