Forum / NoMachine for Linux / Temporarily disable logins, prior to restart
Tagged: login disable administration
- This topic has 3 replies, 3 voices, and was last updated 3 years, 4 months ago by Britgirl.
-
AuthorPosts
-
July 13, 2021 at 09:00 #34425ChrisParticipant
We’ve implemented the NoMachine Workstation product on some multi-user workstations for remote operation; these are machines running Red Hat Enterprise Linux 8, that are shared among several shift workers. When in use via NoMachine, each user gets a virtual desktop session, and often we have several people logged in at once. We’ve had these workstations (or some prior version of them) for many years; the use of NoMachine here is relatively new.
Sometimes these machines need to be restarted for maintenance reasons (about once a week around here), and there’s never a good consistent time to do this when they’re not in use. In normal situations prior to the adoption of NoMachine, we could use the /etc/nologin file for its usual purpose in these situations, to prevent users from logging in until the next restart. We could send a notification of the upcoming restart, and then create the file, and existing users’ sessions are not interrupted so they have time to finish what they’re doing and log out. Users attempting to log in during this period are presented with an informative message, letting them know the system is about to go down. This works for the local text console, graphical logins via gdm, and remote SSH logins, and the solution can be easily scripted if the maintenance operation is scheduled or regularly recurring.
For some reason NoMachine does not correctly recognize the presence of this file however, and allows users to log in anyway.
What is the equivalent operation under NoMachine, to temporarily disable logins for all users, without terminating existing sessions?
I haven’t managed to find anything relevant, searching the knowledge base and the forums. Closest thing I found was a reference in the KB to the “LoginScreenAccess” setting in server.cfg, which didn’t seem like the correct thing (and I verified, it doesn’t work for this purpose).
July 14, 2021 at 14:53 #34455CarinParticipantHi Chris,
Please take a look at the following sections in our NoMAchine Workstation – Installation and Configuration Guide
How to stop new connections, without shutting down existing sessions
https://knowledgebase.nomachine.com/DT11R00174#7.4.How to broadcast a message to all existing sessions
https://knowledgebase.nomachine.com/DT11R00174#8.1As an alternative, you can also adopt a custom script (UserScriptBeforeLogin) to detect if ‘nologin’ file exists and refuses to login in that case.
https://knowledgebase.nomachine.com/DT11R00174#11.5July 21, 2021 at 08:24 #34530ChrisParticipantThank you for the information — this is very useful, especially the whiteboard tool.
However, I’m confused by the first link, which does not contain any mention of “stopping new connections without shutting down existing connections” — I don’t find anything similar in the text, only a generic description of stopping and starting “a network service”. No specific instructions for this situation (eg. which specific service(s) to stop, while leaving existing user sessions running). There is nothing in this text that appears to specifically apply to my question.
I’m wondering if the section you’re referring to with that URL doesn’t exist — indeed, the section at the end of your URL, 7.3, isn’t present in the document, and my browser shows the URL rewritten to https://knowledgebase.nomachine.com/DT11R00178#8.3 when I click your link. So I may not be reading what you intended?
July 23, 2021 at 08:20 #34560BritgirlKeymasterThe link was meant to be:
https://knowledgebase.nomachine.com/DT11R00174#7.2
Sorry about that. I’ve also corrected the embedded link within Carin’s reply so it points to the right anchored section of the Workstation Guide (https://knowledgebase.nomachine.com/DT11R00174)
Please try the suggestions in 7.2 and let us know.
-
AuthorPosts
This topic was marked as solved, you can't post.