Howto sudo » Historie » Version 1
Jeremias Keihsler, 13.01.2017 11:03
1 | 1 | Jeremias Keihsler | h1. sudo |
---|---|---|---|
2 | |||
3 | is a alias for @substitute user do@, it allows user to run programs with root-privileges. |
||
4 | |||
5 | h2. usage |
||
6 | |||
7 | example: run @yum update@ |
||
8 | <pre><code class="bash"> |
||
9 | sudo yum update |
||
10 | </code></pre> |
||
11 | example: show available commands |
||
12 | <pre><code class="bash"> |
||
13 | sudo -l |
||
14 | </code></pre> |
||
15 | |||
16 | h2. config /etc/sudoers.d |
||
17 | |||
18 | make a separate file for each user |
||
19 | <pre><code class="bash"> |
||
20 | visudo -f zabbix |
||
21 | </code></pre> |
||
22 | <pre zabbix> |
||
23 | zabbix ALL = NOPASSWD:/usr/local/bin/get_smart_value.sh |
||
24 | </pre> |
||
25 | <pre trusted_user> |
||
26 | trusted_user ALL=/bin/bash |
||
27 | </pre> |
||
28 | h2. check configuration |
||
29 | |||
30 | <pre><code class="bash"> |
||
31 | visudo -c |
||
32 | </code></pre> |