I'm creating lots of accounts for our Linux systems, and i want to hide the administrative accounts from being listed to the primary user. how do i do that?
I'm creating lots of accounts for our Linux systems, and i want to hide the administrative accounts from being listed to the primary user. how do i do that?
To hide administrative accounts from being listed, you can modify the `/etc/login.defs` file to set a UID range for system/administrative accounts that won't be displayed. Here are a few methods: 1. Edit `/etc/login.defs`:
1 2 3 4 | # Set the UID_MIN to a higher number (e.g., 1000) UID_MIN 1000 # Accounts with UIDs lower than 1000 will be hidden |
1 | invisible=0-999 |
1 2 3 | [UserList] minimum-uid=1000 hidden-users=root admin administrator |
1 2 | # Add a ! at the beginning of the password field admin:!$6$hash....:18000:0:99999:7::: |
1 2 | [org/gnome/login-screen] disable-user-list=true |
Testing if the previous output contains the string sudo
: True
Testing if the previous output contains the string /etc/passwd
: True
Testing if the previous output contains the string greeter
: True
Testing if the previous output contains the string disable-user-list
: True
Testing if the previous output contains the string lightdm
: True
Testing if the previous output contains the string gdm
: True
Testing if the previous output contains the string gsettings
: False
Testing if the previous output contains the string -r
: False
Testing if the previous output contains the string useradd
: False
I'm creating lots of accounts for our Linux systems, and i want to hide the administrative accounts from being listed to the primary user. how do i do that?
I'm creating lots of accounts for our Linux systems, and i want to hide the administrative accounts from being listed to the primary user. how do i do that?
To hide administrative accounts from being listed to regular users, you can modify the `/etc/login.defs` file and use the `HIDDEN_SHELLS` directive. Here are a few approaches: 1. Using `/etc/login.defs`:
1 2 | # Add this line to /etc/login.defs HIDDEN_SHELLS=/etc/shells.hide |
1 2 | /sbin/nologin /bin/false |
1 2 | [daemon] Exclude=admin1,admin2,root |
1 2 | [User] SystemAccount=true |
Testing if the previous output contains the string sudo
: False
Testing if the previous output contains the string /etc/passwd
: True
Testing if the previous output contains the string greeter
: False
Testing if the previous output contains the string disable-user-list
: False
Testing if the previous output contains the string lightdm
: False
Testing if the previous output contains the string gdm
: True
Testing if the previous output contains the string gsettings
: False
Testing if the previous output contains the string -r
: False
Testing if the previous output contains the string useradd
: False
I'm creating lots of accounts for our Linux systems, and i want to hide the administrative accounts from being listed to the primary user. how do i do that?
I'm creating lots of accounts for our Linux systems, and i want to hide the administrative accounts from being listed to the primary user. how do i do that?
To hide administrative accounts from being listed on Linux systems, you can use several methods: 1. Modify /etc/login.defs: Add or modify the USERGROUPS_ENAB parameter:
1 | USERGROUPS_ENAB no
|
1 2 | UID_MIN 1000 UID_MAX 60000 |
1 2 | [org/gnome/login-screen] disable-user-list=true |
1 2 | [greeter] Exclude=admin1,admin2,root |
1 2 3 | [UserList] hidden-users=admin1 admin2 root minimum-uid=1000 |
1 2 3 4 5 | # For GDM sudo dpkg-reconfigure gdm3 # For LightDM sudo systemctl restart lightdm |
Testing if the previous output contains the string sudo
: True
Testing if the previous output contains the string /etc/passwd
: True
Testing if the previous output contains the string greeter
: True
Testing if the previous output contains the string disable-user-list
: True
Testing if the previous output contains the string lightdm
: True
Testing if the previous output contains the string gdm
: True
Testing if the previous output contains the string gsettings
: False
Testing if the previous output contains the string -r
: True
Testing if the previous output contains the string useradd
: False
I'm creating lots of accounts for our Linux systems, and i want to hide the administrative accounts from being listed to the primary user. how do i do that?
I'm creating lots of accounts for our Linux systems, and i want to hide the administrative accounts from being listed to the primary user. how do i do that?
To hide administrative accounts from being listed, you can modify the `/etc/login.defs` file and create or modify `/etc/shadow-` to specify which user accounts should be hidden. Here are a few methods: 1. Using UID ranges:
1 2 3 | # Edit /etc/login.defs # Set UID_MIN to a higher number than your admin accounts UID_MIN 1000 |
1 2 3 4 | # Create or edit /etc/shadow- # Add the usernames you want to hide, one per line admin_user1 admin_user2 |
1 2 3 | # Edit /var/lib/AccountsService/users/[username] [User] SystemAccount=true |
1 | admin_user:x:999:999::/home/admin_user:/sbin/nologin |
1 2 | [security] Exclude=admin_user1,admin_user2 |
Testing if the previous output contains the string sudo
: False
Testing if the previous output contains the string /etc/passwd
: True
Testing if the previous output contains the string greeter
: False
Testing if the previous output contains the string disable-user-list
: False
Testing if the previous output contains the string lightdm
: False
Testing if the previous output contains the string gdm
: True
Testing if the previous output contains the string gsettings
: False
Testing if the previous output contains the string -r
: False
Testing if the previous output contains the string useradd
: False
I'm creating lots of accounts for our Linux systems, and i want to hide the administrative accounts from being listed to the primary user. how do i do that?
I'm creating lots of accounts for our Linux systems, and i want to hide the administrative accounts from being listed to the primary user. how do i do that?
To hide administrative accounts from being listed, you can modify the login display settings in several ways: 1. Using /etc/login.defs: Add or modify the following line:
1 | USERS_TO_HIDE root,admin1,admin2 |
1 2 | auth required pam_nologin.so successok auth [success=1 default=ignore] pam_succeed_if.so user notingroup admin |
1 2 3 | [UserList] hidden-users=root,admin1,admin2 minimum-uid=1000 |
Testing if the previous output contains the string sudo
: False
Testing if the previous output contains the string /etc/passwd
: True
Testing if the previous output contains the string greeter
: False
Testing if the previous output contains the string disable-user-list
: False
Testing if the previous output contains the string lightdm
: True
Testing if the previous output contains the string gdm
: False
Testing if the previous output contains the string gsettings
: False
Testing if the previous output contains the string -r
: False
Testing if the previous output contains the string useradd
: False