Removing Hidden User 'nx' from macOS

How to remove hidden user like NoMachine 'nx' from your Mac.

A few years back, I tried the NoMachine app for remote access to my old MacBook. It was a good app, but it didn’t really cover my needs. So I decided to remove it entirely from my MacBook.

I thought the uninstall was complete, but then I realized NoMachine left a hidden user behind.

At first, I saw a Standard Account called nx on my Mac. I was surprised, I thought there was malware trying to infect my MacBook.

But then I searched online and saw that the nx account was created by NoMachine. I guess the certain version I installed forgot to remove it. That kind of made me relieved.

But it begs a question: Is it possible there are more hidden users on my Mac? Let’s dive in.

Finding Hidden Users List on macOS

Open your Terminal and enter the following command. This will display a detailed and formatted plist of Apple’s Login Window.

defaults read /Library/Preferences/com.apple.loginwindow

Here’s an example full output from my MacBook.

{
    AccountInfo =     {
        FirstLogins =         {
            junian = 1;
        };
        MaximumUsers = 1;
        OnConsole =         {
        };
    };
    GuestEnabled = 0;
    HiddenUsersList =     (
        nx
    );
    OptimizerLastRunForBuild = 42272992;
    OptimizerLastRunForSystem = 184811520;
    UseVoiceOverLegacyMigrated = 1;
    lastLoginPanic = "648027791.289909";
    lastUser = loggedIn;
    lastUserName = junian;
    showInputMenu = 1;
}

Take a look at the HiddenUsersList key, it contains a list of hidden users on your Mac. In my case, luckily, it only has nx from NoMachine.

HiddenUsersList =     (
    nx
);

Hopefully, it returns empty on your Mac, so you don’t have to do the cleanup.

Removing Hidden Users List from macOS

What to do if you find a hidden user? That depends.

If, for example, you still use NoMachine, you still need that nx user account to make it fully functional.

But if NoMachine is removed, there is no reason to keep it here.

Enter the following command from Terminal to remove the hidden users list.

sudo defaults write /Library/Preferences/com.apple.loginwindow HiddenUsersList -array

Once that’s done, if you check the plist again, the HiddenUsersList will be empty.

HiddenUsersList =     (
);

Now with no hidden user on Mac, you can feel safer.

Final Thoughts

Thanks for reading my blog!

Hopefully, this post is somewhat useful. Leave a comment below to discuss your experience.

References