This repository was archived by the owner on Jun 20, 2022. It is now read-only.
File tree 1 file changed +69
-0
lines changed
CSE 381 (Systems II - OS, Currency, Virtualization, and Security)/Linux User Management
1 file changed +69
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Linux User Management
2
+
3
+ ## Users
4
+
5
+ Add user:
6
+
7
+ useradd -c "Full Name" username
8
+
9
+ Add user with custom group and custom default shell:
10
+
11
+ useradd -s /bin/sh -g groupname username
12
+
13
+ Add/change password:
14
+
15
+ passwd username
16
+
17
+ Set expiration date for account:
18
+
19
+ usermod -e YYYY-MM-DD username
20
+
21
+ Set password expiration date:
22
+
23
+ chage -l username
24
+
25
+ Examine hashed password:
26
+
27
+ grep username /etc/passwd
28
+
29
+ Examine properties of user:
30
+
31
+ id username
32
+
33
+ Change user ID:
34
+
35
+ usermod -u 1600 username
36
+
37
+ Move to new group ID:
38
+
39
+ usermod -g 999 username
40
+
41
+ Delete user:
42
+
43
+ userdel -r username
44
+
45
+ ## Groups
46
+
47
+ Create group:
48
+
49
+ groupadd groupname
50
+
51
+ Examine group entry:
52
+
53
+ grep groupname /etc/group
54
+
55
+ Create system group:
56
+
57
+ groupadd -r groupname
58
+
59
+ Change group ID:
60
+
61
+ groupmod -g 1600 groupname
62
+
63
+ Rename group:
64
+
65
+ groupmod -n oldgroupname newgroupname
66
+
67
+ Delete group:
68
+
69
+ groupdel groupname
You can’t perform that action at this time.
0 commit comments