linux - Sudo error message -
i trying fix permission issues on debian server. on team of mine changing permissions around, , somewhere in process, things got screwed up. whenever sudo now, error message/warning:
sudo: /var/lib/sudo writable non-owner (040720), should mode 0700
i'm confused number in parenthesis. mean? also, command run set such permissions? how should these permissions set?
the /var/lib/sudo
permissions are:
drwx-w---- 5 root sudo 4096 feb 4 02:36 sudo
which understand mean: directory read write executable root, , writeable sudo group, , no privileges rest of users. correct?
the last 3 digits of permission mode owner, group, , other users respectively, , sum of following values:
4 read (r)
2 write (w)
1 execute (x)
so if /var/lib/subo ***720, means:
- owner permissions = 7 = 4 + 2 + 1 = read + write + execute
- group permissions = 2 = write
- other permissions = 0 = no permissions.
so yes, correct in interpretation of line of output.
file mode changed chmod
command
chmod mode file
now, interesting thing can specify mode octal number or more human readable string (read below). fix warning you'd chmod 700 /var/lib/sudo
, or more sudo chmod 700 /var/lib/sudo
.
the more readable form needs little more explanation, though:
- use
u
,g
, oro
indicate user, group, or other - use
+
or-
grant or revoke permissions - use
r
,w
, orx
read, write, or execute.
so here that'd chmod g-w /var/lib/sudo
, which, in pseudo-english, reads change mode: group, revoke write, of /var/lib/sudo.
Comments
Post a Comment