Config sudo » Historie » Version 1
Jeremias Keihsler, 13.01.2017 09:39
1 | 1 | Jeremias Keihsler | h1. Configure sudo (sudoers-list) |
---|---|---|---|
2 | |||
3 | h2. Requirements |
||
4 | |||
5 | To install ssh you will need the following: |
||
6 | * a installed and supported operating system (e.g. CentOS 7.x) |
||
7 | * root-access |
||
8 | |||
9 | h2. Preliminary Note |
||
10 | |||
11 | @sudo@ allows any user to run commands or a shell as root. Use this with care. This is better than allow everyone access the root-shell directly as there is no easy way to trace who was root when. |
||
12 | |||
13 | This information was taken from |
||
14 | * http://wiki.centos.org/TipsAndTricks/BecomingRoot |
||
15 | * http://centoshelp.org/security/sudo-an-advanced-howto |
||
16 | |||
17 | h2. Install |
||
18 | |||
19 | @sudo@ is installed by default. |
||
20 | |||
21 | h2. Config |
||
22 | |||
23 | To configure the sudoers-list CentOS supplies the tool @visudo@. Don't use any other editor to manipulate the sudoers-list. |
||
24 | |||
25 | to edit the basic sudo.conf by |
||
26 | <pre><code class="bash"> |
||
27 | visudo |
||
28 | </code></pre> |
||
29 | |||
30 | if you want to add user-specific rules you might |
||
31 | <pre><code class="bash"> |
||
32 | visudo -f /etc/sudoers.d/user |
||
33 | </code></pre> |
||
34 | |||
35 | check the config by |
||
36 | <pre><code class="bash"> |
||
37 | visudo -c |
||
38 | </code></pre> |
||
39 | |||
40 | h2. Test |
||
41 | |||
42 | <pre><code class="bash"> |
||
43 | sudo -i |
||
44 | </code></pre> |
||
45 | |||
46 | h2. Troubleshooting |
||
47 | |||
48 | If the command is not allowed to be executed you may use following commands to check the configuration: |
||
49 | |||
50 | as root |
||
51 | <pre><code class="bash"> |
||
52 | visudo -c |
||
53 | </code></pre> |