{"id":11365,"date":"2025-05-07T06:49:11","date_gmt":"2025-05-07T06:49:11","guid":{"rendered":"https:\/\/mainvps.net\/blog\/?p=11365"},"modified":"2026-04-22T05:02:39","modified_gmt":"2026-04-22T05:02:39","slug":"centos-list-users-the-enterprise-admins-complete-guide","status":"publish","type":"post","link":"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/","title":{"rendered":"CentOS List Users: The Enterprise Admin&#8217;s Complete Guide"},"content":{"rendered":"\r\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_83 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#Why_CentOS_User_Management_Matters\" >Why CentOS User Management Matters<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#Essential_User_Listing_Commands_With_CentOS_Context\" >Essential User Listing Commands (With CentOS Context)<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#1_The_CentOS_etcpasswd_Structure\" >1. The CentOS \/etc\/passwd Structure<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#2_Enterprise-Ready_User_Filtering\" >2. Enterprise-Ready User Filtering<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#Advanced_Enterprise_User_Discovery\" >Advanced Enterprise User Discovery<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#1_Listing_Domain-Joined_Users\" >1. Listing Domain-Joined Users<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#2_SELinux_User_Mapping\" >2. SELinux User Mapping<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#3_Systemd_Service_Accounts\" >3. Systemd Service Accounts<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#Security_Auditing_Compliance\" >Security Auditing &amp; Compliance<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#1_Password_Policy_Checks\" >1. Password Policy Checks<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#2_Sudo_Privileges_Audit\" >2. Sudo Privileges Audit<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#3_Last_Login_Tracking\" >3. Last Login Tracking<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#Enterprise_Tools_Scripts\" >Enterprise Tools &amp; Scripts<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#1_Comprehensive_User_Report_Script\" >1. Comprehensive User Report Script<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#42_Cockpit_Web_Interface\" >4.2 Cockpit Web Interface<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#Conclusion_The_CentOS_Admins_Advantage\" >Conclusion: The CentOS Admin&#8217;s Advantage<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#FAQs_CentOS_User_Management\" >FAQs: CentOS User Management<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#Q1_How_do_I_list_all_users_in_CentOS\" >Q1: How do I list all users in CentOS?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#Q2_How_to_list_only_regular_human_users\" >Q2: How to list only regular human users?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#Q3_How_to_check_if_CentOS_is_joined_to_a_domain\" >Q3: How to check if CentOS is joined to a domain?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#Q4_How_to_list_users_from_FreeIPALDAP\" >Q4: How to list users from FreeIPA\/LDAP?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#Q5_How_to_find_users_with_passwordless_login\" >Q5: How to find users with passwordless login?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#Q6_How_to_check_password_expiration_policies\" >Q6: How to check password expiration policies?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#Q7_How_to_list_SELinux_user_mappings\" >Q7: How to list SELinux user mappings?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#Q8_How_to_see_which_Linux_users_map_to_SELinux_users\" >Q8: How to see which Linux users map to SELinux users?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#Q9_Why_dont_domain_users_appear_in_etcpasswd\" >Q9: Why don&#8217;t domain users appear in \/etc\/passwd?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-27\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#Q10_How_to_find_which_users_recently_logged_in\" >Q10: How to find which users recently logged in?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-28\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#Q11_How_to_list_systemd_dynamic_users\" >Q11: How to list systemd dynamic users?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-29\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#Q12_How_to_audit_sudo_privileges\" >Q12: How to audit sudo privileges?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-30\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#Q13_Whats_the_proper_way_to_audit_users_in_production\" >Q13: What&#8217;s the proper way to audit users in production?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-31\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#Q14_How_often_should_we_review_user_accounts\" >Q14: How often should we review user accounts?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-32\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#Q15_Where_are_user_login_attempts_logged\" >Q15: Where are user login attempts logged?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-33\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/#Q16_How_is_CentOS_user_management_different_from_regular_Linux\" >Q.16 How is CentOS user management different from regular Linux?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_CentOS_User_Management_Matters\"><\/span><strong>Why CentOS User Management Matters<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<p>For system administrators working with CentOS (and its RHEL-compatible successors like Rocky Linux and AlmaLinux), user management isn&#8217;t just about listing accounts &#8211; it&#8217;s about enterprise-grade security, compliance, and system integration. Unlike generic <a href=\"https:\/\/mainvps.net\/blog\/how-to-list-users-in-linux\/\">Linux user guides<\/a>, CentOS list users requires special attention to:<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>SELinux user contexts<\/li>\r\n\r\n\r\n\r\n<li>Enterprise authentication methods (LDAP, Kerberos, Active Directory)<\/li>\r\n\r\n\r\n\r\n<li>Systemd-related service accounts<\/li>\r\n\r\n\r\n\r\n<li>Strict UID\/GID conventions for compliance<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p>This guide goes beyond basic\u00a0<em><strong>cat \/etc\/passwd<\/strong><\/em>\u00a0commands to show you the professional way to audit users in CentOS environments. For basic listing of user, systema admin and human user visit &#8211; <a href=\"https:\/\/mainvps.net\/blog\/how-to-list-users-in-linux\/\">Linux list users<\/a><\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Essential_User_Listing_Commands_With_CentOS_Context\"><\/span><strong>Essential User Listing Commands (With CentOS Context)<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_The_CentOS_etcpasswd_Structure\"><\/span><strong>1. The CentOS \/etc\/passwd Structure<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>bash<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\" style=\"font-size: 18px;\"><em># Always use -w to avoid line breaks in corporate environments<\/em>\r\ngetent -w passwd<\/pre>\r\n\r\n\r\n\r\n<p><strong>Key Differences from Generic Linux:<\/strong><\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>System accounts range from UID 1-200 (not just 1-999)<\/li>\r\n\r\n\r\n\r\n<li>Special service accounts like\u00a0<code>systemd-network<\/code>\u00a0(UID 192)<\/li>\r\n\r\n\r\n\r\n<li>SELinux users appear with\u00a0<code>_<\/code>\u00a0prefix (e.g.,\u00a0<code>_ssh_keys<\/code>)<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Enterprise-Ready_User_Filtering\"><\/span><strong>2. Enterprise-Ready User Filtering<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>bash<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\" style=\"font-size: 18px;\"><em># List only human users (CentOS starts regular UIDs at 1000)<\/em>\r\nawk -F: '$3 &gt;= 1000 &amp;&amp; $3 &lt; 60000 {print $1}' \/etc\/passwd\r\n\r\n<em># Find service accounts (CentOS-specific range)<\/em>\r\nawk -F: '$3 &gt;= 1 &amp;&amp; $3 &lt; 1000 {print $1}' \/etc\/passwd<\/pre>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Advanced_Enterprise_User_Discovery\"><\/span><strong>Advanced Enterprise User Discovery<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Listing_Domain-Joined_Users\"><\/span><strong>1. Listing Domain-Joined Users<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>bash<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\" style=\"font-size: 18px;\"><em># Check FreeIPA\/LDAP integration<\/em>\r\nipa user-find\r\n\r\n<em># For Active Directory joined systems:<\/em>\r\nrealm list\r\nadcli list-users<\/pre>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_SELinux_User_Mapping\"><\/span><strong>2. SELinux User Mapping<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>bash<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\" style=\"font-size: 18px;\"><em># Show SELinux user contexts<\/em>\r\nsemanage user -l\r\n\r\n<em># Find which Linux users map to SELinux users<\/em>\r\nsemanage login -l<\/pre>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Systemd_Service_Accounts\"><\/span><strong>3. Systemd Service Accounts<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>bash<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\" style=\"font-size: 18px;\"><em># List dynamic users created by systemd<\/em>\r\nsystemctl show --property=DynamicUser * | grep -i true<\/pre>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Security_Auditing_Compliance\"><\/span><strong>Security Auditing &amp; Compliance<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Password_Policy_Checks\"><\/span><strong>1. Password Policy Checks<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>bash<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\" style=\"font-size: 18px;\"><em># Check password aging (CentOS uses chage)<\/em>\r\nfor user in $(cut -d: -f1 \/etc\/passwd); do \r\n  echo -n \"$user: \"; \r\n  chage -l $user | grep \"Password expires\"; \r\ndone<\/pre>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Sudo_Privileges_Audit\"><\/span><strong>2. Sudo Privileges Audit<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>bash<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\" style=\"font-size: 18px;\"><em># CentOS-specific sudoers locations<\/em>\r\ngrep -r -i \"ALL=(ALL)\" \/etc\/sudoers.d\/<\/pre>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Last_Login_Tracking\"><\/span><strong>3. Last Login Tracking<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>bash<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\" style=\"font-size: 18px;\"><em># CentOS maintains additional logs in \/var\/log\/secure<\/em>\r\ngrep \"Accepted password\" \/var\/log\/secure* | awk '{print $9}'<\/pre>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Enterprise_Tools_Scripts\"><\/span><strong>Enterprise Tools &amp; Scripts<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Comprehensive_User_Report_Script\"><\/span><strong>1. Comprehensive User Report Script<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>bash<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\" style=\"font-size: 18px;\">#!\/bin\/bash\r\necho \"CENTOS USER AUDIT REPORT - $(date)\"\r\necho \"====================================\"\r\n\r\necho -e \"\\n[1] LOCAL USERS\"\r\ngetent passwd | awk -F: '$3 &gt;= 1000 {print $1}' | while read user; do\r\n  echo -n \"$user: \"\r\n  groups $user | cut -d: -f2\r\ndone\r\n\r\necho -e \"\\n[2] DOMAIN USERS\"\r\nrealm list 2&gt;\/dev\/null || echo \"Not domain-joined\"\r\n\r\necho -e \"\\n[3] RECENT LOGINS\"\r\nlast -n 10<\/pre>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"42_Cockpit_Web_Interface\"><\/span><strong>4.2 Cockpit Web Interface<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>bash<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\" style=\"font-size: 19px;\"><em># Enable for GUI management<\/em>\r\nsudo systemctl enable --now cockpit.socket<\/pre>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion_The_CentOS_Admins_Advantage\"><\/span><strong>Conclusion: The CentOS Admin&#8217;s Advantage<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<p>Unlike generic <a href=\"https:\/\/mainvps.net\/blog\/check-cpu-info-on-linux\/\">Linux<\/a> systems, CentOS provides:<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>Tighter integration with enterprise authentication<\/li>\r\n\r\n\r\n\r\n<li>Better compliance tracking through SELinux<\/li>\r\n\r\n\r\n\r\n<li>More detailed system logging<\/li>\r\n\r\n\r\n\r\n<li>Stronger default security policies<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p><strong>Pro Tip:<\/strong>\u00a0Bookmark this command for daily use:<\/p>\r\n\r\n\r\n\r\n<p>bash<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\" style=\"font-size: 18px;\">sudo ausearch -m USER_LOGIN --interpret  <em># Audit user logins via SELinux<\/em><\/pre>\r\n\r\n\r\n\r\n<p>This guide gives you the specialized knowledge needed to properly manage users in CentOS environments.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"FAQs_CentOS_User_Management\"><\/span><strong>FAQs: CentOS User Management<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Q1_How_do_I_list_all_users_in_CentOS\"><\/span><strong>Q1: How do I list all users in CentOS?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>bash<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\" style=\"font-size: 18px;\">getent passwd<\/pre>\r\n\r\n\r\n\r\n<p>This list all users in Centos including system accounts, local users, and domain users (if integrated with <a href=\"https:\/\/www.techtarget.com\/searchmobilecomputing\/definition\/LDAP\" target=\"_blank\" rel=\"noopener\">LDAP<\/a>\/Active Directory).<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Q2_How_to_list_only_regular_human_users\"><\/span><strong>Q2: How to list only regular human users?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>bash<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\" style=\"font-size: 18px;\">awk -F: '$3 &gt;= 1000 &amp;&amp; $3 &lt; 60000 {print $1}' \/etc\/passwd<\/pre>\r\n\r\n\r\n\r\n<p>CentOS typically assigns regular users UIDs starting from 1000.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Q3_How_to_check_if_CentOS_is_joined_to_a_domain\"><\/span><strong>Q3: How to check if CentOS is joined to a domain?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>bash<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\" style=\"font-size: 18px;\">realm list<\/pre>\r\n\r\n\r\n\r\n<p>This shows Active Directory or FreeIPA domain join status.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Q4_How_to_list_users_from_FreeIPALDAP\"><\/span><strong>Q4: How to list users from FreeIPA\/LDAP?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>bash<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\" style=\"font-size: 18px;\">ipa user-find  <em># For FreeIPA<\/em>\r\ngetent passwd | grep '@'  <em># For general LDAP<\/em><\/pre>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Q5_How_to_find_users_with_passwordless_login\"><\/span><strong>Q5: How to find users with passwordless login?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>bash<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\" style=\"font-size: 18px;\">sudo grep '^[^:]*::' \/etc\/shadow<\/pre>\r\n\r\n\r\n\r\n<p><strong>Warning:<\/strong>\u00a0These accounts are security risks in enterprise environments.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Q6_How_to_check_password_expiration_policies\"><\/span><strong>Q6: How to check password expiration policies?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>bash<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\" style=\"font-size: 18px;\">sudo chage -l username  <em># For specific user<\/em>\r\nsudo grep ^PASS \/etc\/login.defs  <em># Default policies<\/em><\/pre>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Q7_How_to_list_SELinux_user_mappings\"><\/span><strong>Q7: How to list SELinux user mappings?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>bash<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\" style=\"font-size: 18px;\">semanage user -l<\/pre>\r\n\r\n\r\n\r\n<p>Shows SELinux user types like\u00a0<code>staff_u<\/code>,\u00a0<code>user_u<\/code>, etc.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Q8_How_to_see_which_Linux_users_map_to_SELinux_users\"><\/span><strong>Q8: How to see which Linux users map to SELinux users?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>bash<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\" style=\"font-size: 18px;\">semanage login -l<\/pre>\r\n\r\n\r\n\r\n<p>Critical for troubleshooting access denied errors.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Q9_Why_dont_domain_users_appear_in_etcpasswd\"><\/span><strong>Q9: Why don&#8217;t domain users appear in \/etc\/passwd?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>Domain users are managed externally. Use:<\/p>\r\n\r\n\r\n\r\n<p>bash<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\" style=\"font-size: 18px;\">getent passwd  <em># Shows both local and domain users<\/em>\r\nid username  <em># Check if a domain user exists<\/em><\/pre>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Q10_How_to_find_which_users_recently_logged_in\"><\/span><strong>Q10: How to find which users recently logged in?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>bash<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\" style=\"font-size: 19px;\">last -n 20  <em># Last 20 logins<\/em>\r\ngrep \"Accepted password\" \/var\/log\/secure*  <em># Detailed auth logs<\/em><\/pre>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Q11_How_to_list_systemd_dynamic_users\"><\/span><strong>Q11: How to list systemd dynamic users?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>bash<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\" style=\"font-size: 18px;\">systemctl show --property=DynamicUser * | grep -i true<\/pre>\r\n\r\n\r\n\r\n<p>These are temporary service accounts that don&#8217;t exist in \/etc\/passwd.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Q12_How_to_audit_sudo_privileges\"><\/span><strong>Q12: How to audit sudo privileges?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>bash<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\" style=\"font-size: 18px;\">sudo -l  <em># For current user<\/em>\r\ngrep -r \"ALL=(ALL)\" \/etc\/sudoers.d\/  <em># All privileged users<\/em><\/pre>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Q13_Whats_the_proper_way_to_audit_users_in_production\"><\/span><strong>Q13: What&#8217;s the proper way to audit users in production?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>bash<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\" style=\"font-size: 18px;\">sudo ausearch -m USER_LOGIN --interpret | less<\/pre>\r\n\r\n\r\n\r\n<p>Uses SELinux audit logs for comprehensive tracking.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Q14_How_often_should_we_review_user_accounts\"><\/span><strong>Q14: How often should we review user accounts?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>Monthly for compliance (SOX, HIPAA)<\/li>\r\n\r\n\r\n\r\n<li>Quarterly for general maintenance<\/li>\r\n\r\n\r\n\r\n<li>Immediately after employee termination<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Q15_Where_are_user_login_attempts_logged\"><\/span><strong>Q15: Where are user login attempts logged?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>bash<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\" style=\"font-size: 18px;\">\/var\/log\/secure  <em># Primary auth log<\/em><br \/>\/var\/log\/audit\/audit.log  <em># SELinux audit logs<\/em><\/pre>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Q16_How_is_CentOS_user_management_different_from_regular_Linux\"><\/span>Q.16 How is CentOS user management different from regular Linux?<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>CentOS adds enterprise features like SELinux and LDAP integration. For standard <a href=\"https:\/\/mainvps.net\/linux-vps-hosting\">Linux<\/a> user listing methods, consult our\u00a0<a href=\"https:\/\/mainvps.net\/blog\/how-to-list-users-in-linux\/\" target=\"_blank\" rel=\"noreferrer noopener\">Linux List Users<\/a>\u00a0article.<\/p>\r\n\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>Why CentOS User Management Matters For system administrators working with CentOS (and its RHEL-compatible successors like Rocky Linux and AlmaLinux), user management isn&#8217;t just about listing <a class=\"read-more-link\" href=\"https:\/\/mainvps.net\/blog\/centos-list-users-the-enterprise-admins-complete-guide\/\">Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":11579,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-11365","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-servers"],"_links":{"self":[{"href":"https:\/\/mainvps.net\/blog\/wp-json\/wp\/v2\/posts\/11365","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mainvps.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mainvps.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mainvps.net\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/mainvps.net\/blog\/wp-json\/wp\/v2\/comments?post=11365"}],"version-history":[{"count":7,"href":"https:\/\/mainvps.net\/blog\/wp-json\/wp\/v2\/posts\/11365\/revisions"}],"predecessor-version":[{"id":12608,"href":"https:\/\/mainvps.net\/blog\/wp-json\/wp\/v2\/posts\/11365\/revisions\/12608"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mainvps.net\/blog\/wp-json\/wp\/v2\/media\/11579"}],"wp:attachment":[{"href":"https:\/\/mainvps.net\/blog\/wp-json\/wp\/v2\/media?parent=11365"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mainvps.net\/blog\/wp-json\/wp\/v2\/categories?post=11365"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mainvps.net\/blog\/wp-json\/wp\/v2\/tags?post=11365"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}