How does sudo achieve changing the privileges of a process?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
From
man sudo
When sudo executes a command, the security policy specifies the
execution environment for the command. Typically, the real and
effective user and group and IDs are set to match those of the target
user, as specified in the password database, and the group vector is
initialized based on the group database (unless the -P option was
specified).Why does
sudo
change both effective and real user/group IDs to
those of the target user, instead of just effective user/group IDs?Are effective user/group IDs not the only ones needed to take on the
privileges of the target user?From https://unix.stackexchange.com/a/333245/674
changing the effective user and group ID's of a process is only one way of changing the privileges of a process, the security policy
defined in sudo.conf can use any other kind of parameters in the
above list.In order to change the privileges, are there other ways than
changing the effective user/group IDs? What are they?
Thanks.
My question is inspired from Does `sudo` work in terms of changing the effective user and group IDs of a process?
sudo uid
add a comment |Â
up vote
0
down vote
favorite
From
man sudo
When sudo executes a command, the security policy specifies the
execution environment for the command. Typically, the real and
effective user and group and IDs are set to match those of the target
user, as specified in the password database, and the group vector is
initialized based on the group database (unless the -P option was
specified).Why does
sudo
change both effective and real user/group IDs to
those of the target user, instead of just effective user/group IDs?Are effective user/group IDs not the only ones needed to take on the
privileges of the target user?From https://unix.stackexchange.com/a/333245/674
changing the effective user and group ID's of a process is only one way of changing the privileges of a process, the security policy
defined in sudo.conf can use any other kind of parameters in the
above list.In order to change the privileges, are there other ways than
changing the effective user/group IDs? What are they?
Thanks.
My question is inspired from Does `sudo` work in terms of changing the effective user and group IDs of a process?
sudo uid
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
From
man sudo
When sudo executes a command, the security policy specifies the
execution environment for the command. Typically, the real and
effective user and group and IDs are set to match those of the target
user, as specified in the password database, and the group vector is
initialized based on the group database (unless the -P option was
specified).Why does
sudo
change both effective and real user/group IDs to
those of the target user, instead of just effective user/group IDs?Are effective user/group IDs not the only ones needed to take on the
privileges of the target user?From https://unix.stackexchange.com/a/333245/674
changing the effective user and group ID's of a process is only one way of changing the privileges of a process, the security policy
defined in sudo.conf can use any other kind of parameters in the
above list.In order to change the privileges, are there other ways than
changing the effective user/group IDs? What are they?
Thanks.
My question is inspired from Does `sudo` work in terms of changing the effective user and group IDs of a process?
sudo uid
From
man sudo
When sudo executes a command, the security policy specifies the
execution environment for the command. Typically, the real and
effective user and group and IDs are set to match those of the target
user, as specified in the password database, and the group vector is
initialized based on the group database (unless the -P option was
specified).Why does
sudo
change both effective and real user/group IDs to
those of the target user, instead of just effective user/group IDs?Are effective user/group IDs not the only ones needed to take on the
privileges of the target user?From https://unix.stackexchange.com/a/333245/674
changing the effective user and group ID's of a process is only one way of changing the privileges of a process, the security policy
defined in sudo.conf can use any other kind of parameters in the
above list.In order to change the privileges, are there other ways than
changing the effective user/group IDs? What are they?
Thanks.
My question is inspired from Does `sudo` work in terms of changing the effective user and group IDs of a process?
sudo uid
edited Apr 27 at 7:40
Stephen Kitt
140k22302363
140k22302363
asked Apr 27 at 2:28
Tim
22.6k63224401
22.6k63224401
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
5
down vote
accepted
sudo
changes both the real and effective user ids in order to restrict the resulting processâ privileges. Changing the effective id is sufficient to grant the new process the privileges of the requested user, but doing only that leaves open a gaping hole:setuid
can then be used to assume the privileges of the calling user. To avoid that,sudo
sets the real user id too.The list of possibilities is given in the
sudo
manpage and quoted in the answer youâÂÂre referring to. Some of those have an impact on the child processâ privileges: the SELinux role and type, the Solaris project and privileges, and the BSD login class.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
sudo
changes both the real and effective user ids in order to restrict the resulting processâ privileges. Changing the effective id is sufficient to grant the new process the privileges of the requested user, but doing only that leaves open a gaping hole:setuid
can then be used to assume the privileges of the calling user. To avoid that,sudo
sets the real user id too.The list of possibilities is given in the
sudo
manpage and quoted in the answer youâÂÂre referring to. Some of those have an impact on the child processâ privileges: the SELinux role and type, the Solaris project and privileges, and the BSD login class.
add a comment |Â
up vote
5
down vote
accepted
sudo
changes both the real and effective user ids in order to restrict the resulting processâ privileges. Changing the effective id is sufficient to grant the new process the privileges of the requested user, but doing only that leaves open a gaping hole:setuid
can then be used to assume the privileges of the calling user. To avoid that,sudo
sets the real user id too.The list of possibilities is given in the
sudo
manpage and quoted in the answer youâÂÂre referring to. Some of those have an impact on the child processâ privileges: the SELinux role and type, the Solaris project and privileges, and the BSD login class.
add a comment |Â
up vote
5
down vote
accepted
up vote
5
down vote
accepted
sudo
changes both the real and effective user ids in order to restrict the resulting processâ privileges. Changing the effective id is sufficient to grant the new process the privileges of the requested user, but doing only that leaves open a gaping hole:setuid
can then be used to assume the privileges of the calling user. To avoid that,sudo
sets the real user id too.The list of possibilities is given in the
sudo
manpage and quoted in the answer youâÂÂre referring to. Some of those have an impact on the child processâ privileges: the SELinux role and type, the Solaris project and privileges, and the BSD login class.
sudo
changes both the real and effective user ids in order to restrict the resulting processâ privileges. Changing the effective id is sufficient to grant the new process the privileges of the requested user, but doing only that leaves open a gaping hole:setuid
can then be used to assume the privileges of the calling user. To avoid that,sudo
sets the real user id too.The list of possibilities is given in the
sudo
manpage and quoted in the answer youâÂÂre referring to. Some of those have an impact on the child processâ privileges: the SELinux role and type, the Solaris project and privileges, and the BSD login class.
answered Apr 27 at 5:09
Stephen Kitt
140k22302363
140k22302363
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f440316%2fhow-does-sudo-achieve-changing-the-privileges-of-a-process%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password