Where are the User and Group details stored on my server ?

All Linux distributions should keep their user and group data files in the same place, usually:
  • User account information
    /etc/passwd
  • Secure user account information
    /etc/shadow
  • Group information
    /etc/group
  • Samba Users secure account information
    /etc/smbpasswd

Format of /etc/passwd

The /etc/passwd file gives a listing of the users that have accounts on the system. Users are typically added using the adduser or useradd commands.

username:password:uid:gid:user_info:home_directory:shell_type
username - The name the person logs in with
password - Typically x to indicate a password is set
uid - User ID number set by the system to indicate which files they own or have access to.
gid - Group ID number set by the system to indicate which is the primary group the user belongs to.
user_info - Additional information about the user separated by a commas. Example User_Info Full name, Phone number, etc.
home_directory - The directory that the user owns and shoudl start shell sessions in. Usually /home/username
shell_type - The default shell setting is /bin/bash, for no shell this would be /bin/false etc.

Format of /etc/shadow

The /etc/shadow file holds the users encrypted passwords.

username:encrypted password:11843:0:99999:7:::
username - The username from /etc/passwd that the person logs in with
encrypted password - The encrypted version of the password
#:#:#:#::: - Contains information about the number of days since the password was changed, when it expires or is disabled.

Format of /etc/group

The /etc/group file contains the groups that have been created on the system and lists the members of each group. Groups are typically added using the addgroup or groupadd commands.

Users can be added to an already existing group by adding the additional usernames to the end of the other usernames or after the semicolon of the gid if there are no members beyond the primary user.

groupname:password:gid:username1,username2,username3
groupname - The name the group
password - An x indicates a password is set and if left blank no password has been set.
gid - The group id number which is the principle group they belong to.
usernames - Members of the group separated by a comma

Format of /etc/smbpasswd

The /etc/smbpasswd file contains the encrypted Samba Users password details.

username:encrypted password:11843:0:99999:7:::
username - The username from that the person connect to the Samba service with
encrypted password - The encrypted version of the password
#:#:#:#::: - Contains information about the number of days since the password was changed, when it expires or is disabled.

  • 2 Users Found This Useful
這篇文章有幫助嗎?

相關文章

How do I stop Cpanel reporting /usr/bin/crontab permissions are wrong. Please set to 4755.

If you get this message in CPanel when adding/ediiting/viewing the cron jobs ......

How do I force Statistics (Webalizer and AWstats) to run on Plesk Servers ?

Updating Webalizer and AWStats on Linux Plesk Servers from SSH The plesk control panel is...

How much is HELM ? What Helm licences do you offer ?

Web Host Automation (HELM Authors) sold the control panel rights and code some years ago to...

How much is CPanel ? What CPanel licences do you offer ?

We work with a CPANEL authorised NOC partner, able to offer you discounted CPanel licences for...

How much is Plesk ? What Plesk licences do you offer ?

We are a PLESK authorised sales partner, able to offer you discounted Plesk licences for both...

Powered by WHMCompleteSolution