regularvs
systemgroups, won't be repeating "accounts or groups" hereafter .
awk ' /\yUID_MIN
\y/ { uidMin=$2 } /\yUID_MAX
\y/ { uidMax=$2 } /\ySYS_UID_MIN
\y/ { sysUidMin=$2 } /\ySYS_UID_MAX
\y/ { sysUidMax=$2 } END { print "Range of UIDs :\n\tsystem accounts : \t"sysUidMin"-"sysUidMax"\n\tregular accounts :\t"uidMin"-"uidMax } ' /etc/login.defs
Range of UIDs : system accounts : 100-999 regular accounts : 1000-60000
awk ' /\yGID_MIN
\y/ { gidMin=$2 } /\yGID_MAX
\y/ { gidMax=$2 } /\ySYS_GID_MIN
\y/ { sysGidMin=$2 } /\ySYS_GID_MAX
\y/ { sysGidMax=$2 } END { print "Range of GIDs :\n\tsystem groups : \t"sysGidMin"-"sysGidMax"\n\tregular groups :\t"gidMin"-"gidMax } ' /etc/login.defs
Range of GIDs : system groups : 100-999 regular groups : 1000-60000
On a Linux system, users belong to 2 group types :
Action | Linux | FreeBSD |
---|---|---|
add a user account | adduser + follow on-screen instructions | |
delete a user account |
userdel -r kevin -r : delete the user's home directory too. |
rmuser kevin |
lock a user account | usermod -L kevin | Details about LOCKED accounts |
unlock a user account |
usermod -U kevin
This removes the ! in front of the encrypted password in /etc/shadow |
|
get date of latest user login | lastlog | grep kevin | |
create a new group | groupadd newGroupName | pw group add groupName |
delete a group | pw group del groupName | |
list all groups | less /etc/group (also shows group members) | pw group show -a |
add a user into an existing group |
|
|
remove a user from a group |
|
|
list the members of a group | grep 'groupName' /etc/group |
|
list the last n logins of a user | last -n stuart | less | |
List the groups a user belongs to | ||
to know which unix users are currently connected | who | |
to read details about a user account on a local/distant host |
|
This will display the users list, the encrypted passwords and *LOCKED* before it when applicable.
pw lock kevin
session required pam_limits.so
stuart hard nproc maximumNumberOfProcesses