Linux Commands for managing users:
1. adduser – Command used to add user accounts.
2. chage – Used to change the time the user’s password will expire.
3. chfn – Change a user’s finger information
4. chsh – Change a user’s shell.
5. chgrp – Changes the group ownership of files.
6. chown – Change the owner of file(s ) to another user.
7. gpasswd – Used to administer the /etc/group file.
8. groupadd – Create a new group.
9. grpconv – Creates /etc/gshadow from the file /etc/group which converts to shadow passwords.
10. grpunconv- Uses the files /etc/passwd and /etc/shadow to create /etc/passwd, then deletes /etc/shadow which converts from shadow passwords.
11. groupdel – Delete a group
12. groupmod – Modify a group
13. groups – print the groups a user is in
14. grpck – Verify the integrity of group files.
15. id – Print group or user ID numbers for the specified user.
16. newgrp – Allows a user to log in to a new group.
17. newusers – Update and create new users in batch form.
18. nologin – Prevent non-root users from logging onto the system.
19. passwd – Used to update a user’s password. The command “passwd username” will set the password
for the given user.
20. pwconv – Used to create the file /etc/shadow from the file /etc/passwd to convert to shadow
passwords.
21. pwunconv – Uses the files /etc/passwd and /etc/shadow to create /etc/passwd, then deletes
/etc/shadow to convert from shadow passwords.
22. su – run a shell with substitute user and group IDs
23. useradd – Create a new user or update default new user information
24. userdel – Delete a user account and their files from the system. The command “userdel -r newuser” will
remove the user and deletes their home directory.
25. usermod – Modify a user account.
Files
1. /etc/passwd – Where the user’s name, and other pertinent information are stored. This includes the
password unless your system is using shadow passwords.
2. /etc/shadow – Where the user’s password is stored if you are using shadow passwords.
3. /etc/group – Where group names are stored.
4. /etc/aliases – Where the user’s name is matched to a nickname for e-mail.
5. /etc/sudoers – A list of users with special privileges along with the commands they can execute.
User Process Accounting
The following commands are useful for user accounting:
1. ac – Print statistics about users’ connect time.
2. accton – Turn on accounting of processes. To turn it on type “accton /var/log/pacct”.
3. last – Shows a list of users who have logged in.
4. lastb – Shows failed login attempts. This command requires the file /var/log/btmp to exist in order to
work. Type “touch /var/log/btmp” to begin logging to this file.
5. lastcomm – Display information about previous commands in reverse order. Works only if process
accounting is on.
6. sa – Generates a summary of information about users’ processes that are stored in the /var/log/pacct file.
7. utmpdump – Used for debugging.
8. who – Find out what users are logged onto the system.
Files that hold accounting information
1. /var/log/wtmp – Stores information about all logins and logouts.
2. /var/run/utmp – Stores information about who is currently on the system and is used by the who
command.
3. /var/log/btmp – Used to store information about failed logins.
User Quotas
The userquata can be set in two ways
1. The number of inodes the user or group may use.
2. The number of disk blocks a user or group may use.
Commands used to set quotas and limits are:
1. edquota – Used to edit user or group quotas. This program uses the vi editor to edit the quota.user and
quota.group files.
2. quota – Display users’ limits and current disk usage.
3. quotaoff(8) – Turns system quotas off.
4. quotaon(8) – Turn system quotas on.
5. quotacheck(8) – Used to check a filesystem for usage, and update the quota.user file.
6. repquota(8) – Lists a summary of quota information on filesystems.
7. ulimit – A bash builtin command for setting the processes a user can run. The command “ulimit -n 9000″
will set the limit on open files to 9000.
Files that hold information about userquata
1. /etc/mtab
2. quota.user – Resides on the filesystem quotas are being set on.
3. quota.group
No comments:
Post a Comment