You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
\f[CR]sudo\f[R] allows a user that is permitted to do so to execute a
20
23
\f[I]command\f[R] as another user (for example \f[I]root\f[R]).
@@ -31,6 +34,12 @@ The timeout for session records can be specified in the policy.
31
34
.PP
32
35
Some care is taken to pass signals received by sudo\-rs to the child
33
36
process, even if that process runs in its own pseudo terminal.
37
+
.PP
38
+
On systems where sudo is the primary method of gaining superuser
39
+
privileges, it is imperative to avoid syntax errors in the
40
+
\f[CR]/etc/sudoers\f[R] file.
41
+
Changes to this file should be made using the visudo(8) utility which
42
+
will ensure that no syntax errors are introduced.
34
43
.SH OPTIONS
35
44
.TP
36
45
\f[CR]\-B\f[R], \f[CR]\-\-bell\f[R]
@@ -121,6 +130,28 @@ If no shell was specified, the shell from the user\[cq]s password
121
130
database entry will be used instead.
122
131
If a \f[I]command\f[R] is specified, it is passed to the shell using the
123
132
\f[CR]\-c\f[R] option.
133
+
.PP
134
+
\f[CR]\-e\f[R], \f[CR]sudoedit\f[R]
135
+
.IP
136
+
.EX
137
+
Edit one or more files instead of running a command. In lieu of a path name, the string \[dq]sudoedit\[dq] is used when consulting the security policy. If the user is authorized by the policy, the following steps are taken:
138
+
139
+
1. Temporary copies are made of the files to be edited with the owner set to the invoking user.
140
+
141
+
2. The editor specified by the policy is run to edit the temporary files. The sudoers policy uses the SUDO_EDITOR, VISUAL and EDITOR environment variables (in that order). If none of SUDO_EDITOR, VISUAL or EDITOR are set, the first program listed in the editor sudoers(5) option is used.
142
+
143
+
3. If they have been modified, the content of the temporary files is copied back to the originals and the temporary versions are removed.
144
+
145
+
To help prevent the editing of unauthorized files, the following restrictions are enforced (unless the user is root):
146
+
147
+
* Symbolic links may not be edited.
148
+
149
+
* If any component of the path leading to the file is writable by the invoking user, the file may not be edited.
150
+
151
+
* Users are never allowed to edit device special files.
152
+
153
+
If the specified file does not exist, it will be created. Unlike most commands run by sudo, the editor is run with the invoking user\[aq]s environment unmodified. If the temporary file becomes empty after editing, the user will be prompted before it is installed.
@@ -28,6 +32,11 @@ timeout for session records can be specified in the policy.
28
32
Some care is taken to pass signals received by sudo-rs to the child process,
29
33
even if that process runs in its own pseudo terminal.
30
34
35
+
On systems where sudo is the primary method of gaining superuser privileges, it is
36
+
imperative to avoid syntax errors in the `/etc/sudoers` file. Changes to this file
37
+
should be made using the visudo(8) utility which will ensure that no syntax errors
38
+
are introduced.
39
+
31
40
# OPTIONS
32
41
33
42
`-B`, `--bell`
@@ -101,6 +110,26 @@ even if that process runs in its own pseudo terminal.
101
110
was specified, the shell from the user's password database entry will be
102
111
used instead. If a *command* is specified, it is passed to the shell using the `-c` option.
103
112
113
+
`-e`, `sudoedit`
114
+
115
+
Edit one or more files instead of running a command. In lieu of a path name, the string "sudoedit" is used when consulting the security policy. If the user is authorized by the policy, the following steps are taken:
116
+
117
+
1. Temporary copies are made of the files to be edited with the owner set to the invoking user.
118
+
119
+
2. The editor specified by the policy is run to edit the temporary files. The sudoers policy uses the SUDO_EDITOR, VISUAL and EDITOR environment variables (in that order). If none of SUDO_EDITOR, VISUAL or EDITOR are set, the first program listed in the editor sudoers(5) option is used.
120
+
121
+
3. If they have been modified, the content of the temporary files is copied back to the originals and the temporary versions are removed.
122
+
123
+
To help prevent the editing of unauthorized files, the following restrictions are enforced (unless the user is root):
124
+
125
+
* Symbolic links may not be edited.
126
+
127
+
* If any component of the path leading to the file is writable by the invoking user, the file may not be edited.
128
+
129
+
* Users are never allowed to edit device special files.
130
+
131
+
If the specified file does not exist, it will be created. Unlike most commands run by sudo, the editor is run with the invoking user's environment unmodified. If the temporary file becomes empty after editing, the user will be prompted before it is installed.
132
+
104
133
`-u`*user*, `--user`=*user*
105
134
: Run the *command* as another user than the default (**root**).
0 commit comments