You are on page 1of 2

Hoofdstuk 15

Viewing user information

- The id command is used to print user and group information.

To display information for a specific account, use the username as a nargument.

Viewing current users

- The who command list users who are currently logged in as well ass where and when they
logged in.
- The w command provides more detailedd info about users currently on system.

Viewing Login history

- The last command reads the var/log/wtmp


- Shows previous login sessions as wel as curent login info.

Consider This
The who command reads from the /var/log/utmp file which logs current users, while
the last command reads from the /var/log/wtmp file, which keeps a history of all user logins.

Hoofdstuk 16

Creating groups:

- Remember: user account info and authentication info is stored in the /etc/passwd and
/etc/shadow files
- Using these files to add users/groups is possible but not recommended
- Using commands is more appropriate.
- Groupadd command.
- Use -g to specify. Example: groupadd -g 506 research

Group naming conventions:

Modifying in a group:

- The groupmod command can be used to either change the name of the group or change the
gid with the -g.
- To search fora n orphaned file us the find command with the -nogroup option.

Deleting a group:

- The groupdel command can be used to delete a group.


User configuration

- Before creating users, verify the default values using the useradd command
-

H17 ownership and permissions

File ownership

- Critical for ownership


- By default users will own the files they create. Ownership can be changed by admin.
- Every file has a group owner.
- UIDS and GIDs are associated with username and group name
- The id command can be used to view UID and GID username and groupname

When a user creates a file with the touch command i twill belong tot he current user and their
primary group.

Changing groups

To create a file under adifferent gorup, use the newgrp command to change your current group.

Changing group ownership

- To change the group owner of existing files us the chgrp command

Permissions:

- To display the file type and permissions of a file use the ls -l command
- The first character of each line indicatest he type of file. Possible values for file types:

Permissions groups:

You might also like