2

I would like to log myself off my xfce session when I attach to my machine remotely. It's because sometimes I leave a program or two running that holds locks on files that I'd like to work on from a brand new XFCE session that I just established remotely.

I'm familiar with xfce4-session-logout. That only works if you are:

  • logged-in interactively to xfce (you are looking at the GUI on your screen or your remote x11 session)
  • and you launched on a terminal from within your XFCE session (that is now hosted by the above session)

What does not work is remotely SSH'ing to your machine from another location, then attempt to remotely log yourself off. No, that doesn't work. xfce4-session-logout does nothing in this case. It displays errors.

$ ssh <my machine>
<works fine...>
$ xfce4-session-logout --logout
xfce4-session: Received error while trying to log out (Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.).

Typical Scenario:

At Work (Day Time):

  • log into SDDM, starts an XFCE session,
  • Open some files, do some work, save files, leave them open
  • Go home

At Home (Evening):

  • Use x2go to launch a graphical remote xfce session
  • Attempt to open a locked file (darn, file is locked)

At this point, I could attempt to send signals to the programs that hold the files open (which works fine) Sometimes, I really just want to log out the other session and create a new one. That's what I'm asking about here.

  • Killing the session probably works; but this seems hugely inconvenient. Surely a better approach would be to arrange with remote acoess to the already running session...? – tripleee Aug 13 '18 at 15:05
  • Maybe. That would match how Microsoft RDP works. UNIX is able to do both. That said, I wish it were more convenient to opt for either approach. – 010110110101 Aug 14 '18 at 0:05
  • 1
    set XDG_SESSION_COOKIE and DISPLAY environments. – Ipor Sircer Aug 14 '18 at 4:58
  • systemctl restart sddm works, but it's heavy-handed (kills all sessions) – 010110110101 Feb 11 at 13:20
  • loginctl commands such as loginctl terminate-seat seat0 didn't do anything. Prompts for login, but doesn't actually end the session. loginctl has other variations though. – 010110110101 Feb 11 at 13:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.