Search code examples
linuxuserid

linux, command to get the first non-system user id


Is there a linux command to get the first non-system user ID (first "real" user on the system) ? ( excluding root because of that https://superuser.com/questions/626843/does-the-root-account-always-have-uid-gid-0 )


Solution

  • Assuming you mean 'whats the uid of the first user added by the useradd command' - Usually its 1000 (no idea how I know this though)

    also, from a quick google search I found: https://serverfault.com/questions/362943/who-is-user-500

    it appears that it used to be 500 was the first user, but it has changed to 1000

    cat /etc/login.defs | grep UID_MIN
    

    will give you the minimum user id for your system