Home » Questions » Computers [ Ask a new question ]

ssh from within GNU screen does not work properly

ssh from within GNU screen does not work properly

I try to start a screen session and connect to three different machines with the same user.

Asked by: Guest | Views: 268
Total answers/comments: 1
Guest [Entry]

"/usr/X11/bin/xauth: error in locking authority file /home/user/.Xauthority

Do you ever get that same error without screen, after the first SSH session has been established? It's odd that your ""If I remove only one of the machines [..] it works correctly"" seems to say that 2 machines work, but a 3rd yields problems. If ssh supports multiple X-forwarded connections, then it might just be a matter of doing things more slowly? That can best be tested without screen I guess. And what if you change the order of the machines?

It guess that this .Xauthority file is on the remote machine, but I am no expert. (If /home/user in your question was in fact a more specific directory, then you can probably easily tell if it's local or remote.) So, odd question: are you sure that all 3 machines are really different machines, and that no-one else is using the same account? From man ssh:

ssh will also automatically set up Xauthority data on the server machine.
For this purpose, it will generate a random authorization cookie, store
it in Xauthority on the server, and verify that any forwarded connections
carry this cookie and replace it by the real cookie when the connection
is opened. The real authentication cookie is never sent to the server
machine (and no cookies are sent in the plain).

(And couldn't you replace screen with ssh -f -N, or are you using the screen's title to be able to stop things?)"