Skip to content

Commit 9465970

Browse files
UGM6 complete
1 parent 8ad0200 commit 9465970

File tree

10 files changed

+1003
-0
lines changed

10 files changed

+1003
-0
lines changed

UGM6/groups/index.html

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>groups Command Explanation</title>
7+
<link rel="stylesheet" href="style.css">
8+
</head>
9+
<body>
10+
<div class="container">
11+
<h1>Understanding the <code>groups</code> Command</h1>
12+
13+
<section>
14+
<h2>Basic Usage of <code>groups</code></h2>
15+
<p>The <code>groups</code> command is used to display the groups to which a user belongs. It can be run without any arguments to show the groups of the current user or with a username to display the groups for a specified user.</p>
16+
<div class="code-block">
17+
<code>groups [USERNAME]</code>
18+
</div>
19+
</section>
20+
21+
<section>
22+
<h2>Common Options for <code>groups</code></h2>
23+
<p>The <code>groups</code> command has limited options, primarily focused on its output format:</p>
24+
<ul>
25+
<li><code>-n, --no-numeric</code> - Show the group names instead of numeric group IDs.</li>
26+
<li><code>-h, --help</code> - Display help information and exit.</li>
27+
</ul>
28+
</section>
29+
30+
<section>
31+
<h2>Examples of <code>groups</code> Command</h2>
32+
33+
<h3>Show Groups for Current User</h3>
34+
<div class="code-block">
35+
<code>groups</code>
36+
</div>
37+
<p>This command will display the groups for the currently logged-in user.</p>
38+
39+
<h3>Show Groups for a Specific User</h3>
40+
<div class="code-block">
41+
<code>groups username</code>
42+
</div>
43+
<p>This command will display the groups for the specified <code>username</code>.</p>
44+
45+
<h3>Show Groups with Numeric IDs</h3>
46+
<div class="code-block">
47+
<code>groups -n</code>
48+
</div>
49+
<p>This command will show the groups with their numeric IDs instead of their names.</p>
50+
</section>
51+
52+
<section>
53+
<h2>Understanding Group Management</h2>
54+
<p>Groups are used in Linux to manage user permissions and access controls. When a user is part of a group:</p>
55+
<ul>
56+
<li>The user inherits permissions and privileges assigned to that group.</li>
57+
<li>Group memberships can be used to simplify administration, allowing multiple users to share access to files and resources.</li>
58+
<li>Users can be added or removed from groups by an administrator using commands like <code>usermod</code> or <code>gpasswd</code>.</li>
59+
</ul>
60+
</section>
61+
62+
<section>
63+
<h2>Summary of Options</h2>
64+
<table>
65+
<thead>
66+
<tr>
67+
<th>Option</th>
68+
<th>Description</th>
69+
</tr>
70+
</thead>
71+
<tbody>
72+
<tr>
73+
<td><code>-n, --no-numeric</code></td>
74+
<td>Show the group names instead of numeric group IDs.</td>
75+
</tr>
76+
<tr>
77+
<td><code>-h, --help</code></td>
78+
<td>Display help information and exit.</td>
79+
</tr>
80+
</tbody>
81+
</table>
82+
</section>
83+
</div>
84+
</body>
85+
</html>

UGM6/groups/style.css

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
body {
2+
font-family: Arial, sans-serif;
3+
background-color: #f0f8ff;
4+
margin: 0;
5+
padding: 0;
6+
}
7+
8+
.container {
9+
max-width: 900px;
10+
margin: 40px auto;
11+
padding: 20px;
12+
background-color: #fff;
13+
border-radius: 8px;
14+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
15+
}
16+
17+
h1 {
18+
color: #1e90ff;
19+
margin-bottom: 20px;
20+
}
21+
22+
h2 {
23+
color: #1e90ff;
24+
margin-top: 20px;
25+
}
26+
27+
h3 {
28+
margin-top: 15px;
29+
color: #444;
30+
}
31+
32+
p {
33+
margin-bottom: 15px;
34+
}
35+
36+
ul {
37+
margin-top: 10px;
38+
padding-left: 20px;
39+
}
40+
41+
li {
42+
margin-bottom: 10px;
43+
}
44+
45+
.code-block {
46+
background-color: #f4f4f4;
47+
padding: 10px;
48+
border-left: 3px solid #1e90ff;
49+
margin: 10px 0;
50+
font-family: monospace;
51+
}
52+
53+
code {
54+
font-family: monospace;
55+
color: #c7254e;
56+
background-color: #f9f2f4;
57+
padding: 2px 4px;
58+
border-radius: 4px;
59+
}
60+
61+
table {
62+
width: 100%;
63+
border-collapse: collapse;
64+
margin-top: 15px;
65+
}
66+
67+
thead {
68+
background-color: #1e90ff;
69+
color: #fff;
70+
}
71+
72+
th, td {
73+
padding: 10px;
74+
border: 1px solid #ddd;
75+
text-align: left;
76+
}
77+
78+
tbody tr:nth-child(even) {
79+
background-color: #f4f4f4;
80+
}

UGM6/passwd/index.html

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>passwd Command Explanation</title>
7+
<link rel="stylesheet" href="style.css">
8+
</head>
9+
<body>
10+
<div class="container">
11+
<h1>Understanding the <code>passwd</code> Command</h1>
12+
13+
<section>
14+
<h2>Basic Usage of <code>passwd</code></h2>
15+
<p>The <code>passwd</code> command is used to change a user's password in Linux systems. It allows users to set or modify their own passwords and, when executed by the root user, can change passwords for any user.</p>
16+
<div class="code-block">
17+
<code>passwd [OPTIONS] [USERNAME]</code>
18+
</div>
19+
</section>
20+
21+
<section>
22+
<h2>Common Options for <code>passwd</code></h2>
23+
<p>The <code>passwd</code> command supports several options:</p>
24+
<ul>
25+
<li><code>-d, --delete</code> - Delete the user's password, allowing access without a password.</li>
26+
<li><code>-l, --lock</code> - Lock the user's password, preventing login.</li>
27+
<li><code>-u, --unlock</code> - Unlock the user's password, allowing login again.</li>
28+
<li><code>-e, --expire</code> - Expire the user's password immediately, forcing a change at the next login.</li>
29+
<li><code--status</code> - Display the status of the user's password.</li>
30+
<li><code>-h, --help</code> - Display help information and exit.</li>
31+
</ul>
32+
</section>
33+
34+
<section>
35+
<h2>Examples of <code>passwd</code> Command</h2>
36+
37+
<h3>Change Own Password</h3>
38+
<div class="code-block">
39+
<code>passwd</code>
40+
</div>
41+
<p>This command prompts the user to enter their current password and then the new password to update it.</p>
42+
43+
<h3>Change Another User's Password</h3>
44+
<div class="code-block">
45+
<code>sudo passwd username</code>
46+
</div>
47+
<p>This command allows the root user to change the password for the specified <code>username</code>.</p>
48+
49+
<h3>Lock a User's Password</h3>
50+
<div class="code-block">
51+
<code>sudo passwd -l username</code>
52+
</div>
53+
<p>This command locks the password for <code>username</code>, preventing the user from logging in until the password is unlocked.</p>
54+
55+
<h3>Unlock a User's Password</h3>
56+
<div class="code-block">
57+
<code>sudo passwd -u username</code>
58+
</div>
59+
<p>This command unlocks the password for <code>username</code>, allowing them to log in again.</p>
60+
61+
<h3>Expire a User's Password</h3>
62+
<div class="code-block">
63+
<code>sudo passwd -e username</code>
64+
</div>
65+
<p>This command expires the password for <code>username</code>, requiring them to change it at the next login.</p>
66+
</section>
67+
68+
<section>
69+
<h2>Understanding Password Management</h2>
70+
<p>When a password is changed using the <code>passwd</code> command:</p>
71+
<ul>
72+
<li>The new password is stored in an encrypted format in the <code>/etc/shadow</code> file.</li>
73+
<li>Account locking prevents the user from logging in, even if they know the correct password.</li>
74+
<li>Expiring a password forces the user to create a new one at the next login, enhancing security.</li>
75+
</ul>
76+
</section>
77+
78+
<section>
79+
<h2>Summary of Options</h2>
80+
<table>
81+
<thead>
82+
<tr>
83+
<th>Option</th>
84+
<th>Description</th>
85+
</tr>
86+
</thead>
87+
<tbody>
88+
<tr>
89+
<td><code>-d, --delete</code></td>
90+
<td>Delete the user's password, allowing access without a password.</td>
91+
</tr>
92+
<tr>
93+
<td><code>-l, --lock</code></td>
94+
<td>Lock the user's password, preventing login.</td>
95+
</tr>
96+
<tr>
97+
<td><code>-u, --unlock</code></td>
98+
<td>Unlock the user's password, allowing login again.</td>
99+
</tr>
100+
<tr>
101+
<td><code>-e, --expire</code></td>
102+
<td>Expire the user's password immediately.</td>
103+
</tr>
104+
<tr>
105+
<td><code>--status</code></td>
106+
<td>Display the status of the user's password.</td>
107+
</tr>
108+
<tr>
109+
<td><code>-h, --help</code></td>
110+
<td>Display help information and exit.</td>
111+
</tr>
112+
</tbody>
113+
</table>
114+
</section>
115+
</div>
116+
</body>
117+
</html>

UGM6/passwd/style.css

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
body {
2+
font-family: Arial, sans-serif;
3+
background-color: #f0f8ff;
4+
margin: 0;
5+
padding: 0;
6+
}
7+
8+
.container {
9+
max-width: 900px;
10+
margin: 40px auto;
11+
padding: 20px;
12+
background-color: #fff;
13+
border-radius: 8px;
14+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
15+
}
16+
17+
h1 {
18+
color: #1e90ff;
19+
margin-bottom: 20px;
20+
}
21+
22+
h2 {
23+
color: #1e90ff;
24+
margin-top: 20px;
25+
}
26+
27+
h3 {
28+
margin-top: 15px;
29+
color: #444;
30+
}
31+
32+
p {
33+
margin-bottom: 15px;
34+
}
35+
36+
ul {
37+
margin-top: 10px;
38+
padding-left: 20px;
39+
}
40+
41+
li {
42+
margin-bottom: 10px;
43+
}
44+
45+
.code-block {
46+
background-color: #f4f4f4;
47+
padding: 10px;
48+
border-left: 3px solid #1e90ff;
49+
margin: 10px 0;
50+
font-family: monospace;
51+
}
52+
53+
code {
54+
font-family: monospace;
55+
color: #c7254e;
56+
background-color: #f9f2f4;
57+
padding: 2px 4px;
58+
border-radius: 4px;
59+
}
60+
61+
table {
62+
width: 100%;
63+
border-collapse: collapse;
64+
margin-top: 15px;
65+
}
66+
67+
thead {
68+
background-color: #1e90ff;
69+
color: #fff;
70+
}
71+
72+
th, td {
73+
padding: 10px;
74+
border: 1px solid #ddd;
75+
text-align: left;
76+
}
77+
78+
tbody tr:nth-child(even) {
79+
background-color: #f4f4f4;
80+
}

0 commit comments

Comments
 (0)