Advanced User Man Flashcards

1
Q

Set password aging parameters for user100 to mindays 7, maxdays 28, and warndays 5:

A

chage -m 7 -M 26 -W 5 user100

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

show pasword aging settings

A

chage -l user100

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Set the account expiry to Jan 31 2020

A

chage -E 2020-01-31 user100

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Set password aging attributes for user200 to mindays 10, maxdays 90, and warndays 14:
**with passwd

A

passwd -n 10 -x 90 -w 14 user200

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

see passwd status

A

passwd -S user200

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

set the number of inactivity days to 5

A

passwd -i5 user200

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

for user to change password at next login

A

passwd -e user200

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

lock a user

A

usermod -L user200
passwd -l user200

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

unlock user

A

usermod -U user200
passwd -u user200

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Create the group linuxadm with GID 5000:

A

groupadd -g 5000 linuxadm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Create a group called dba with the same GID as that of group linuxadm:

A

groupadd -o -g 5000 dba
-o is needed as it is ‘non-standard’ and has the same GID as another group. Inherits same perms as other group

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

where are groups stored

A

/etc/groups

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Add user1 as a secondary member of group dba using the usermod command. The existing membership for the user must remain intact.

A

usermod -aG dba user1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

confirm user1 is in dba group

A

grep dba /etc/group
id user1
groups user1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

alter name of linuxadm group to sysadm

A

groupmod -n sysadm linuxadm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

change GID of a group

A

groupmod -g 6000 sysadm

17
Q

delete group

A

groupdel sysadm

18
Q

show who you are currently logged in as

A

whoami

19
Q

show the identity of who originally logged in

A

logname

20
Q

edit sudoers file

A

visudo

21
Q

give user full access to admin functions with visudo

A

edit top of file
user1 ALL=(ALL) ALL

22
Q

edit sudoer file so user1 does not have to use their password

A

visudo
user1 ALL=(ALL) NOPASSWD:ALL

23
Q

give user sudo access to cat command

A

user1 ALL=/usr/bin/cat

24
Q

Next, assign PKGCMD to PKGADM. This way one rule is set that allows a group of users access to a group of commands. You can add or remove commands and users anytime as needed, and the change will take effect right
away.

A

Cmnd_Alias PKGCMD = /usr/bin/yum, /usr/bin/rpm
User_Alias PKGADM = user1, user100, user200
PKGADM ALL = PKGCMD

25
Q

change ownership of a file

A

chown user100 file.txt

26
Q

change group ownership of a file

A

chgrp dbagroup file.txt

27
Q

Change the ownership to user200 and owning group to user100

A

chown user200:user100 file.txt

28
Q

Modify the ownership to user200 and owning group to dba recursively on dir10

A

chown -R user200:dba dir10