Who is allowed to read/write /etc/sudoers ? Why are these the “correct” permissi
ID: 3889815 • Letter: W
Question
Who is allowed to read/write /etc/sudoers ? Why are these the
“correct” permissions for this file – with reference to the three permissions (r/w/x)
for each of the three class (user/group/other)?
What are the permissions of the sudo command? Explain how setuid
is used in the context of sudo and /etc/sudoers and why it is required.
Please explain and show step ! This is one question
Please help!
The sudo command allows users to become root. The list of users allowed to become root is in the file /etc/sudoersExplanation / Answer
Example for sudoer file how to give a particular user full access to only certain file:
let as expect that a Files have two proprietors: a user, and a group. For instance:
$ ls - l filename.txt
- rw-rw-r- - 1 kim 2 dec 9 15:37 filename.txt
Here, the user and group are both kim.
We can change document proprietorship utilizing chown. Note that the connection connects to a manpage for Linux, yet chown is really standard so it will likely work. If all else fails, counsel your OS's manual (man chown).
For instance, changing the group to zim:
$ chown :zim filename.txt
$ ls - l filename.txt
- rw-rw-r- - 1 kim zim 2 dec 9 15:37 filename.txt
Note that the zim assemble requirements to exist. Promote beneath you'll perceive how to include new groups.
Authorizations/permissions:
The authorizations are as per the following:
- rw-rw-r- -
Tuuugggooo
where T is the sort; for typical the name of the file this is - , for catalogs d, for emblematic connections l and so forth.
The uuu are the user consents: rw-: read, compose. The ggg assemble authorizations are likewise rw-. Every other person (ooo) gets r- - , or, read-just access.
We can change the consents utilizing chmod (once more, a Linux manpage, however chmod is entirely standard). In the event that we needed to expel the compose consent for aggregate zim from the record, we could do:
$ chmod g-w filename.txt
$ ls - l filename.txt
- rw-r- - r- - 1 kim zim 2 dec 9 15:37 filename.txt
Including another group
You could include a group particularly to manage access to a few documents. How this is done is stage subordinate. For Linux, there is addgroup:
addgroup zim
there is pw. Check your Operating System manual for the right order to utilize!
Adding users to groups
This once more, is stage subordinate. For FreeBSD, the pw order specified above handles this. For Linux, it is usermod.
users commonly have an essential or introductory group, and auxiliary or supplementary groups. The essential group is utilized when new records are made.
For linux, including (- a) user kim to the auxiliary (- G) zim gather is done this way:
$ usermod - G zim - a kim
Presently, whenever user kim sign in, his/her groups will be refreshed. Utilize the id charge Linux id/FreeBSD id: entirely standard) to examine the group participation:
$ id
uid=1000(kim) gid=1000(kim) groups=1000(kim),1001(zim)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.