Execute command as a restricted group without entering password

Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I want to prevent some apps from going to network, so I've created a no-internet group:sudo groupadd -g 9876 no-internet
and created a script sudo gedit /usr/bin/ni
#!/bin/bash
sg no-internet "$1"
And added an iptable rule
#!/bin/bash
iptables -A OUTPUT -m owner --gid-owner no-internet -j DROP
Now ni my_command should run an app in a restricted mode. However, I am getting sg: failed to crypt password with previous salt: Invalid argument
How can I run an app as 'no-internet group`, without limiting my own access to LAN/WAN?
I've checked this question (claiming that requirements are contradictory)
How to switch a group without asking for a password?
But is it really so?
users
add a comment |Â
up vote
1
down vote
favorite
I want to prevent some apps from going to network, so I've created a no-internet group:sudo groupadd -g 9876 no-internet
and created a script sudo gedit /usr/bin/ni
#!/bin/bash
sg no-internet "$1"
And added an iptable rule
#!/bin/bash
iptables -A OUTPUT -m owner --gid-owner no-internet -j DROP
Now ni my_command should run an app in a restricted mode. However, I am getting sg: failed to crypt password with previous salt: Invalid argument
How can I run an app as 'no-internet group`, without limiting my own access to LAN/WAN?
I've checked this question (claiming that requirements are contradictory)
How to switch a group without asking for a password?
But is it really so?
users
is user usingniinno-internetgroup ?
â Archemar
Mar 25 at 13:47
I am a user (admin with root rights). I want to runni untrusted-appin order to prevent this app from talking to internet. I don't want to block my own access to internet though.
â sixtytrees
Mar 25 at 22:26
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I want to prevent some apps from going to network, so I've created a no-internet group:sudo groupadd -g 9876 no-internet
and created a script sudo gedit /usr/bin/ni
#!/bin/bash
sg no-internet "$1"
And added an iptable rule
#!/bin/bash
iptables -A OUTPUT -m owner --gid-owner no-internet -j DROP
Now ni my_command should run an app in a restricted mode. However, I am getting sg: failed to crypt password with previous salt: Invalid argument
How can I run an app as 'no-internet group`, without limiting my own access to LAN/WAN?
I've checked this question (claiming that requirements are contradictory)
How to switch a group without asking for a password?
But is it really so?
users
I want to prevent some apps from going to network, so I've created a no-internet group:sudo groupadd -g 9876 no-internet
and created a script sudo gedit /usr/bin/ni
#!/bin/bash
sg no-internet "$1"
And added an iptable rule
#!/bin/bash
iptables -A OUTPUT -m owner --gid-owner no-internet -j DROP
Now ni my_command should run an app in a restricted mode. However, I am getting sg: failed to crypt password with previous salt: Invalid argument
How can I run an app as 'no-internet group`, without limiting my own access to LAN/WAN?
I've checked this question (claiming that requirements are contradictory)
How to switch a group without asking for a password?
But is it really so?
users
asked Mar 25 at 2:39
sixtytrees
1062
1062
is user usingniinno-internetgroup ?
â Archemar
Mar 25 at 13:47
I am a user (admin with root rights). I want to runni untrusted-appin order to prevent this app from talking to internet. I don't want to block my own access to internet though.
â sixtytrees
Mar 25 at 22:26
add a comment |Â
is user usingniinno-internetgroup ?
â Archemar
Mar 25 at 13:47
I am a user (admin with root rights). I want to runni untrusted-appin order to prevent this app from talking to internet. I don't want to block my own access to internet though.
â sixtytrees
Mar 25 at 22:26
is user using
ni in no-internet group ?â Archemar
Mar 25 at 13:47
is user using
ni in no-internet group ?â Archemar
Mar 25 at 13:47
I am a user (admin with root rights). I want to run
ni untrusted-app in order to prevent this app from talking to internet. I don't want to block my own access to internet though.â sixtytrees
Mar 25 at 22:26
I am a user (admin with root rights). I want to run
ni untrusted-app in order to prevent this app from talking to internet. I don't want to block my own access to internet though.â sixtytrees
Mar 25 at 22:26
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
user running sg command must be the group being sued uppon.
here I belong to www-data group
archemar@unix:~$ id
uid=1003(archemar) gid=1002(stackexchange) groups=1002(stackexchange),27(sudo),33(www-data)
sg goes OK
archemar@unix:~$ sg www-data id
uid=1003(archemar) gid=33(www-data) groups=33(www-data),27(sudo),1002(stackexchange)
my gid is www-data
Now, I don't belong to ntp group
archemar@unix:~$ sg ntp id
Password:
sg: failed to crypt password with previous salt: Invalid argument
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
user running sg command must be the group being sued uppon.
here I belong to www-data group
archemar@unix:~$ id
uid=1003(archemar) gid=1002(stackexchange) groups=1002(stackexchange),27(sudo),33(www-data)
sg goes OK
archemar@unix:~$ sg www-data id
uid=1003(archemar) gid=33(www-data) groups=33(www-data),27(sudo),1002(stackexchange)
my gid is www-data
Now, I don't belong to ntp group
archemar@unix:~$ sg ntp id
Password:
sg: failed to crypt password with previous salt: Invalid argument
add a comment |Â
up vote
0
down vote
user running sg command must be the group being sued uppon.
here I belong to www-data group
archemar@unix:~$ id
uid=1003(archemar) gid=1002(stackexchange) groups=1002(stackexchange),27(sudo),33(www-data)
sg goes OK
archemar@unix:~$ sg www-data id
uid=1003(archemar) gid=33(www-data) groups=33(www-data),27(sudo),1002(stackexchange)
my gid is www-data
Now, I don't belong to ntp group
archemar@unix:~$ sg ntp id
Password:
sg: failed to crypt password with previous salt: Invalid argument
add a comment |Â
up vote
0
down vote
up vote
0
down vote
user running sg command must be the group being sued uppon.
here I belong to www-data group
archemar@unix:~$ id
uid=1003(archemar) gid=1002(stackexchange) groups=1002(stackexchange),27(sudo),33(www-data)
sg goes OK
archemar@unix:~$ sg www-data id
uid=1003(archemar) gid=33(www-data) groups=33(www-data),27(sudo),1002(stackexchange)
my gid is www-data
Now, I don't belong to ntp group
archemar@unix:~$ sg ntp id
Password:
sg: failed to crypt password with previous salt: Invalid argument
user running sg command must be the group being sued uppon.
here I belong to www-data group
archemar@unix:~$ id
uid=1003(archemar) gid=1002(stackexchange) groups=1002(stackexchange),27(sudo),33(www-data)
sg goes OK
archemar@unix:~$ sg www-data id
uid=1003(archemar) gid=33(www-data) groups=33(www-data),27(sudo),1002(stackexchange)
my gid is www-data
Now, I don't belong to ntp group
archemar@unix:~$ sg ntp id
Password:
sg: failed to crypt password with previous salt: Invalid argument
answered Mar 26 at 7:37
Archemar
18.9k93366
18.9k93366
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%2f433360%2fexecute-command-as-a-restricted-group-without-entering-password%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
is user using
niinno-internetgroup ?â Archemar
Mar 25 at 13:47
I am a user (admin with root rights). I want to run
ni untrusted-appin order to prevent this app from talking to internet. I don't want to block my own access to internet though.â sixtytrees
Mar 25 at 22:26