Projekt

Allgemein

Profil

Howto sudo » Historie » Version 1

Jeremias Keihsler, 05.09.2024 07:44

1 1 Jeremias Keihsler
h1. sudo
2
3
is an alias for @substitute user do@, it allows user to run programs with root-privileges.
4
5
h2. usage
6
7
example: run @dnf update@
8
<pre><code class="shell">
9
sudo dnf update
10
</code></pre>
11
example: show available commands
12
<pre><code class="shell">
13
sudo -l
14
</code></pre>
15
16
h2. config wheel group
17
18
any user in @wheel@ is allowed to sudo into everything
19
20
<pre><code class="shell">
21
usermod -aG wheel USERNAME
22
</code></pre>
23
24
h2. config /etc/sudoers.d
25
26
make a separate file for each user
27
<pre><code class="shell">
28
visudo -f /etc/sudoers.d/zabbix
29
</code></pre>
30
<pre zabbix>
31
zabbix ALL = NOPASSWD:/usr/local/bin/get_smart_value.sh
32
</pre>
33
<pre trusted_user>
34
trusted_user ALL=/bin/bash
35
</pre>
36
37
h2. check configuration
38
39
<pre><code class="shell">
40
visudo -c
41
</code></pre>