How to know what program needs which group to be executed without sudo












1















In particular I want to create bridges dynamically, but without the need of running it with sudo. I think it's the group netdev.



But is there, and I'm sure there is, a general answer to the question: How can I determine the group needed to run a program without typing sudo in front of the command










share|improve this question























  • This lloks like two questions. Run command without sudo (use /etc/sudoers.d) for group netdev and find which group (top) a command runs under! Which should it be?

    – George Udosen
    Dec 13 '18 at 14:44








  • 2





    I'm not sure that's really the right question: in the example you give, AFAIK it's not about permissions required to run the program, it's about the permissions required for the program to modify a device file

    – steeldriver
    Dec 13 '18 at 14:47











  • I think he means how do you know which group you should add to user so the user don't have to use sudo.

    – Alvin Liang
    Dec 13 '18 at 14:51











  • @AlvinLiang yes that's what I mean.

    – Kev Inski
    Dec 13 '18 at 18:11
















1















In particular I want to create bridges dynamically, but without the need of running it with sudo. I think it's the group netdev.



But is there, and I'm sure there is, a general answer to the question: How can I determine the group needed to run a program without typing sudo in front of the command










share|improve this question























  • This lloks like two questions. Run command without sudo (use /etc/sudoers.d) for group netdev and find which group (top) a command runs under! Which should it be?

    – George Udosen
    Dec 13 '18 at 14:44








  • 2





    I'm not sure that's really the right question: in the example you give, AFAIK it's not about permissions required to run the program, it's about the permissions required for the program to modify a device file

    – steeldriver
    Dec 13 '18 at 14:47











  • I think he means how do you know which group you should add to user so the user don't have to use sudo.

    – Alvin Liang
    Dec 13 '18 at 14:51











  • @AlvinLiang yes that's what I mean.

    – Kev Inski
    Dec 13 '18 at 18:11














1












1








1








In particular I want to create bridges dynamically, but without the need of running it with sudo. I think it's the group netdev.



But is there, and I'm sure there is, a general answer to the question: How can I determine the group needed to run a program without typing sudo in front of the command










share|improve this question














In particular I want to create bridges dynamically, but without the need of running it with sudo. I think it's the group netdev.



But is there, and I'm sure there is, a general answer to the question: How can I determine the group needed to run a program without typing sudo in front of the command







permissions groups installed-programs






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 13 '18 at 14:25









Kev InskiKev Inski

743411




743411













  • This lloks like two questions. Run command without sudo (use /etc/sudoers.d) for group netdev and find which group (top) a command runs under! Which should it be?

    – George Udosen
    Dec 13 '18 at 14:44








  • 2





    I'm not sure that's really the right question: in the example you give, AFAIK it's not about permissions required to run the program, it's about the permissions required for the program to modify a device file

    – steeldriver
    Dec 13 '18 at 14:47











  • I think he means how do you know which group you should add to user so the user don't have to use sudo.

    – Alvin Liang
    Dec 13 '18 at 14:51











  • @AlvinLiang yes that's what I mean.

    – Kev Inski
    Dec 13 '18 at 18:11



















  • This lloks like two questions. Run command without sudo (use /etc/sudoers.d) for group netdev and find which group (top) a command runs under! Which should it be?

    – George Udosen
    Dec 13 '18 at 14:44








  • 2





    I'm not sure that's really the right question: in the example you give, AFAIK it's not about permissions required to run the program, it's about the permissions required for the program to modify a device file

    – steeldriver
    Dec 13 '18 at 14:47











  • I think he means how do you know which group you should add to user so the user don't have to use sudo.

    – Alvin Liang
    Dec 13 '18 at 14:51











  • @AlvinLiang yes that's what I mean.

    – Kev Inski
    Dec 13 '18 at 18:11

















This lloks like two questions. Run command without sudo (use /etc/sudoers.d) for group netdev and find which group (top) a command runs under! Which should it be?

– George Udosen
Dec 13 '18 at 14:44







This lloks like two questions. Run command without sudo (use /etc/sudoers.d) for group netdev and find which group (top) a command runs under! Which should it be?

– George Udosen
Dec 13 '18 at 14:44






2




2





I'm not sure that's really the right question: in the example you give, AFAIK it's not about permissions required to run the program, it's about the permissions required for the program to modify a device file

– steeldriver
Dec 13 '18 at 14:47





I'm not sure that's really the right question: in the example you give, AFAIK it's not about permissions required to run the program, it's about the permissions required for the program to modify a device file

– steeldriver
Dec 13 '18 at 14:47













I think he means how do you know which group you should add to user so the user don't have to use sudo.

– Alvin Liang
Dec 13 '18 at 14:51





I think he means how do you know which group you should add to user so the user don't have to use sudo.

– Alvin Liang
Dec 13 '18 at 14:51













@AlvinLiang yes that's what I mean.

– Kev Inski
Dec 13 '18 at 18:11





@AlvinLiang yes that's what I mean.

– Kev Inski
Dec 13 '18 at 18:11










1 Answer
1






active

oldest

votes


















0














First run the command (I wish you'd told us which) without sudo. Take note of the device(s) mentioned in the error message.



Use ls -l, followed by the device(s), e.g.



walt@bat:~(0)$ ls -l /dev/ttyS1
crw-rw---- 1 root dialout 4, 65 Dec 13 08:34 /dev/ttyS1


This device allows rw access for the owner (root) and members of the dialout group.



To add yourself to the dialout group,



sudo adduser $USER dialout


To make use of your new dialout group membership, either log out and log in, or newgrp dialout to start a shell with that group membership.






share|improve this answer
























  • I am looking for a general answer. But let's assume I use the command brctl addbr. I prefer using the command usermod to add a user to a existing group. So your solution basically is: ls - l $(which brctl) or something similar to get the group?

    – Kev Inski
    Dec 13 '18 at 21:03











  • I don't think there's general answer. If document does not say anything and you don't guess, how do you know which device it will use?

    – Alvin Liang
    Dec 14 '18 at 3:22













Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1100629%2fhow-to-know-what-program-needs-which-group-to-be-executed-without-sudo%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














First run the command (I wish you'd told us which) without sudo. Take note of the device(s) mentioned in the error message.



Use ls -l, followed by the device(s), e.g.



walt@bat:~(0)$ ls -l /dev/ttyS1
crw-rw---- 1 root dialout 4, 65 Dec 13 08:34 /dev/ttyS1


This device allows rw access for the owner (root) and members of the dialout group.



To add yourself to the dialout group,



sudo adduser $USER dialout


To make use of your new dialout group membership, either log out and log in, or newgrp dialout to start a shell with that group membership.






share|improve this answer
























  • I am looking for a general answer. But let's assume I use the command brctl addbr. I prefer using the command usermod to add a user to a existing group. So your solution basically is: ls - l $(which brctl) or something similar to get the group?

    – Kev Inski
    Dec 13 '18 at 21:03











  • I don't think there's general answer. If document does not say anything and you don't guess, how do you know which device it will use?

    – Alvin Liang
    Dec 14 '18 at 3:22


















0














First run the command (I wish you'd told us which) without sudo. Take note of the device(s) mentioned in the error message.



Use ls -l, followed by the device(s), e.g.



walt@bat:~(0)$ ls -l /dev/ttyS1
crw-rw---- 1 root dialout 4, 65 Dec 13 08:34 /dev/ttyS1


This device allows rw access for the owner (root) and members of the dialout group.



To add yourself to the dialout group,



sudo adduser $USER dialout


To make use of your new dialout group membership, either log out and log in, or newgrp dialout to start a shell with that group membership.






share|improve this answer
























  • I am looking for a general answer. But let's assume I use the command brctl addbr. I prefer using the command usermod to add a user to a existing group. So your solution basically is: ls - l $(which brctl) or something similar to get the group?

    – Kev Inski
    Dec 13 '18 at 21:03











  • I don't think there's general answer. If document does not say anything and you don't guess, how do you know which device it will use?

    – Alvin Liang
    Dec 14 '18 at 3:22
















0












0








0







First run the command (I wish you'd told us which) without sudo. Take note of the device(s) mentioned in the error message.



Use ls -l, followed by the device(s), e.g.



walt@bat:~(0)$ ls -l /dev/ttyS1
crw-rw---- 1 root dialout 4, 65 Dec 13 08:34 /dev/ttyS1


This device allows rw access for the owner (root) and members of the dialout group.



To add yourself to the dialout group,



sudo adduser $USER dialout


To make use of your new dialout group membership, either log out and log in, or newgrp dialout to start a shell with that group membership.






share|improve this answer













First run the command (I wish you'd told us which) without sudo. Take note of the device(s) mentioned in the error message.



Use ls -l, followed by the device(s), e.g.



walt@bat:~(0)$ ls -l /dev/ttyS1
crw-rw---- 1 root dialout 4, 65 Dec 13 08:34 /dev/ttyS1


This device allows rw access for the owner (root) and members of the dialout group.



To add yourself to the dialout group,



sudo adduser $USER dialout


To make use of your new dialout group membership, either log out and log in, or newgrp dialout to start a shell with that group membership.







share|improve this answer












share|improve this answer



share|improve this answer










answered Dec 13 '18 at 19:28









waltinatorwaltinator

22k74169




22k74169













  • I am looking for a general answer. But let's assume I use the command brctl addbr. I prefer using the command usermod to add a user to a existing group. So your solution basically is: ls - l $(which brctl) or something similar to get the group?

    – Kev Inski
    Dec 13 '18 at 21:03











  • I don't think there's general answer. If document does not say anything and you don't guess, how do you know which device it will use?

    – Alvin Liang
    Dec 14 '18 at 3:22





















  • I am looking for a general answer. But let's assume I use the command brctl addbr. I prefer using the command usermod to add a user to a existing group. So your solution basically is: ls - l $(which brctl) or something similar to get the group?

    – Kev Inski
    Dec 13 '18 at 21:03











  • I don't think there's general answer. If document does not say anything and you don't guess, how do you know which device it will use?

    – Alvin Liang
    Dec 14 '18 at 3:22



















I am looking for a general answer. But let's assume I use the command brctl addbr. I prefer using the command usermod to add a user to a existing group. So your solution basically is: ls - l $(which brctl) or something similar to get the group?

– Kev Inski
Dec 13 '18 at 21:03





I am looking for a general answer. But let's assume I use the command brctl addbr. I prefer using the command usermod to add a user to a existing group. So your solution basically is: ls - l $(which brctl) or something similar to get the group?

– Kev Inski
Dec 13 '18 at 21:03













I don't think there's general answer. If document does not say anything and you don't guess, how do you know which device it will use?

– Alvin Liang
Dec 14 '18 at 3:22







I don't think there's general answer. If document does not say anything and you don't guess, how do you know which device it will use?

– Alvin Liang
Dec 14 '18 at 3:22




















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1100629%2fhow-to-know-what-program-needs-which-group-to-be-executed-without-sudo%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Can I use Tabulator js library in my java Spring + Thymeleaf project?