Forum / NoMachine for Linux / Best way to regain local access when screen is blanked?
- This topic has 6 replies, 4 voices, and was last updated 6 months, 1 week ago by adamltaylor.
-
AuthorPosts
-
April 18, 2024 at 17:39 #47844adamltaylorParticipant
I use NoMachine to login to my Kubuntu 22.04 box at work from my Kubuntu 22.04 box at home. (I have an active NoMachine Enterprise Desktop sub for the machine at work.) At work, I have NoMachine set up to blank the screen when someone connects, and lock it after disconnection. Sometimes I will connect from home in the evening and forget to disconnect. So then when I go into work the next morning, I cannot (easily) use my work computer. In this situation, what is the best way for me to regain access to my work computer, without having to drive home and disconnect?
If it helps, I can typically ssh into my work computer in this situation, either from my laptop, another person’s computer, or my phone. But even when I do this, it’s not clear to me the *best* way to regain local access, ideally without losing my current session.
Thanks in advance,
Adam
April 18, 2024 at 18:11 #47847BritgirlKeymasterHi!
Remember that screen-blanking is a privacy feature, and an important one that does its job well. It’s there to stop users in the vicinity of the computer seeing sensitive information that the remote user (presumably the session owner) doesn’t want to show. We’ve had similar requests in the past for what to do (same explanation as yours more or less) and apart from pulling the plug… it would mean changing its current design. Changing how it currently works would need careful thought since we wouldn’t want to undermine its security function.
For Linux servers, an option could be to use NoMachine Workstation from the Terminal Server range; you don’t have to use the screen blanking option at all because you could run a virtual Linux desktop and nothing about your remote session would be visible. I’m not sure whether this fits your use case but you could consider it maybe?
April 18, 2024 at 20:40 #47850adamltaylorParticipantIt is understood that this is a privacy feature and that, therefore, one can’t implement something like “Press Ctrl-Alt-r to return control to the local screen.” But, I’m not requesting any new features.
I’m asking about a situation in which I can connect (and authenticate) to the local machine via SSH, and on this machine (although I didn’t say this), I have sudo privileges. I’m wondering if you can tell me the best currently available way to get myself out of the pickle I describe, given that I have SSH’ed in as the same user connected via NoMachine and given that I have sudo privileges.
In the past, I’ve done things like SSH’ing in and then shutting down the NoMachine server with this command:
sudo /usr/NX/bin/nxserver –stop
Then log in normally, restarting NoMachine. The trouble with this is that NoMachine seems to remember that there was a session going, but it blanks the screen again once the server starts, and I have to repeat the procedure. (I also end up losing my running X session.)
I think one time this happened, I SSH’ed in and did:
sudo apt remote NoMachine
This, of course, solved the problem. But again, I lost my running X session, and I also had to reinstall NoMachine. It’s not ideal.
More recently, I did this:
sudo /etc/NX/nxserver –history
<Get the session ID of the connected session>
sudo /etc/NX/nxserver –terminate <session id>
This worked, but again I think I lost the X session.
So: Can you suggest any other procedure that might work better? The ideal procedure would simulate the action of disconnection from the remote end, if that is possible.
Thanks again,
Adam
April 19, 2024 at 08:48 #47851SevvyParticipantBeing able to Ctrl+Alt+F2 to access a CLI shell and a “sudo nomachine –disconnect-remotes” would be helpful and not require altering the X/Wayland screen blank solution..?
April 19, 2024 at 15:08 #47873katpanParticipantInstead of terminating the session, we suggest using the
--disconnect
command. Could you please provide more information about the issue you are experiencing with the lost X session?You can try using the following commands:
sudo /etc/NX/nxserver --disconnect
or
sudo /etc/NX/nxserver --disconnect
Please let us know if the problem persists even after using the above commands.
April 19, 2024 at 16:40 #47878adamltaylorParticipantkatpan: Thank you for those suggestions! I will try those soon.
Hopefully one or both of these methods will lead to me not losing my X session. If that turns out not to be the case, I’ll follow up.
May 1, 2024 at 16:54 #47992adamltaylorParticipantsudo /etc/NX/nxserver –disconnect <username>
is exactly what I was looking for, and worked perfectly. Thank you very much!
Adam
-
AuthorPosts
This topic was marked as solved, you can't post.