Script "nc-who" - similar to unix `who`, follow live who is logged in

Back up. Veilen Dank!

1 Like

Hi Nextcloud-Admins,

by popular demand, nc-who now comes with a " GOD MODE ".

It enables Nextcloud admins to act quickly and efficiently if session tokens have been compromised or stolen, no matter for what reason.
It’s a sharp sword, so please use it wisely.

Example screen (this may change in future):

 = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

   This is the GOD MODE of nc-who.

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

I: Here you can invalidate cookies before they expire by deleting the corresponding authtoken from the
   database.
⚠: The user whose authtoken is deleted, thereby invalidating their cookie, must log in again using their
   credentials and, if configured, a second factor. An ongoing session will also be closed. Error
   messages may occur if the user continues to attempt to retrieve new data, so use this feature only
   after careful consideration.
   If you enter the full word  panic , all cookies will be invalidated and all users will have to log in
   again.
   This applies only to cookie-based browser connections; connections using app tokens are not affected.

+-----------------------------------------------------------------------------------------------------------------+
| pos | last_activity       | status | uid            | client                                                    |
+-----+---------------------+--------+----------------+-----------------------------------------------------------+
|     |                     |        |                | Mozilla/5.0                                               |
| 1   | 2025-04-02 17:28:35 | online | Long_User_Name | (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36    |
|     |                     |        |                | (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36        |
|     |                     |        |                | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/    |
| 2   | 2025-04-02 17:28:02 | online | user           | 537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/       |
|     |                     |        |                | 537.36 OPR/117.0.0.0                                      |
| 3   | 2025-04-02 17:27:26 | away   | user           | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/    |
|     |                     |        |                | 537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 |
|     |                     |        |                | Mozilla/5.0                                               |
| 4   | 2025-04-02 12:08:50 | away   | Long_User_Name | (iPhone; CPU iPhone OS 17_6_1 like Mac OS X) AppleWebKit/ |
|     |                     |        |                | 605.1.15 (KHTML, like Gecko) CriOS/134.0.6998.99 Mo...    |


Please select:

             [pos]  - pos number from the authtoken you want to invalidate

             panic  - invalidate all cookie based tokens

             [ b ]  - go back to selection

             [ q ]  - quit

Enter [pos],  panic , [ b ] or [ q ]:

Much and good luck
ernolf

Thank gawd you posted this on April, 2nd! @ernolf

2 Likes

I have an AIO installation. Do I need to install and run inside a container?
I am having errors:
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.5 LTS
Release: 22.04
Codename: jammy
nc-who monitor
… loading modules - binaries/dev/fd/63: line 120: BINARY: bad array subscript
… loading modules - nc/nextcloudgawk: fatal: cannot open file /version.php' for reading: No such file or directory gawk: fatal: cannot open file /version.php’ for reading: No such file or directory
gawk: fatal: cannot open file /version.php' for reading: No such file or directory gawk: fatal: cannot open file /version.php’ for reading: No such file or directory
gawk: fatal: cannot open file `/version.php’ for reading: No such file or directory

Hi @alauzon,

thank you for your feedback

No, it must NOT to be run from a container, but from the host running AIO. This should be a recent Ubuntu or Debian.

Could you please open an issue on

with as much information as possible, such as which operating system, which AIO, and possibly also the script’s log files located at /tmp/ebtb/log/*.log

I haven’t tested on AIO in a while, which is why your feedback is so valuable. I’ll try to reproduce the error.


ernolf

I could find the cause. It was a typo.
Sorry for the late resolution to your issue. I haven’t had time until now.
It should be working again now.

:crossed_fingers:


ernolf