Run apt-get without sudo
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
13
down vote
favorite
This might be a very naive question, but I wanted to know how I could give multiple users access to a single computer without making them root users. How would I give them limitted sudo access such that they could still issue commands like
sudo apt-get install epstopdf
I imagine this could be an incredibly stupid question as once root user access is given, they could do whatever they want. Therefore, is there any way around this? I am open to suggestions
permissions sudo root multiple-users
add a comment |Â
up vote
13
down vote
favorite
This might be a very naive question, but I wanted to know how I could give multiple users access to a single computer without making them root users. How would I give them limitted sudo access such that they could still issue commands like
sudo apt-get install epstopdf
I imagine this could be an incredibly stupid question as once root user access is given, they could do whatever they want. Therefore, is there any way around this? I am open to suggestions
permissions sudo root multiple-users
add a comment |Â
up vote
13
down vote
favorite
up vote
13
down vote
favorite
This might be a very naive question, but I wanted to know how I could give multiple users access to a single computer without making them root users. How would I give them limitted sudo access such that they could still issue commands like
sudo apt-get install epstopdf
I imagine this could be an incredibly stupid question as once root user access is given, they could do whatever they want. Therefore, is there any way around this? I am open to suggestions
permissions sudo root multiple-users
This might be a very naive question, but I wanted to know how I could give multiple users access to a single computer without making them root users. How would I give them limitted sudo access such that they could still issue commands like
sudo apt-get install epstopdf
I imagine this could be an incredibly stupid question as once root user access is given, they could do whatever they want. Therefore, is there any way around this? I am open to suggestions
permissions sudo root multiple-users
asked Oct 31 '11 at 11:58
puk
60751121
60751121
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
18
down vote
accepted
Open a terminal and type sudo visudo
. At the end of the file (really the last line in it) type %yourusername% ALL=NOPASSWD: /usr/bin/apt-get install
where %yourusername% is replaced by your username.
After that you wont be prompted for a password to use sudo apt-get install
anymore but please understand this is a very risky solution, there is a reason why you need to type a password for some commands, the use of these commands without password can leave your system open for some dangers. Use with caution.
Couldsudo apt-get install
lead to problems by, for example, installing a program which doesrm -f -r /
?
â puk
Oct 31 '11 at 20:43
3
Well, no not really. And if it does you need to typesudo rm -rf /
and the instructions I gave are only to enablesudo apt-get install
, even if you enable a PPA that has that kind of code, even if you install it without really knowing what you are doing and the program tries to run he wont have access... You did not give yourselfsudo rm
permition, onlysudo apt-get install
. Its the safest approach to a insecure situation ;)
â Bruno Pereira
Oct 31 '11 at 20:50
fixed the path to the file was wrong :D the path was not /usr/sbin but /usr/bin ;) it just works
â Bruno Pereira
Oct 31 '11 at 21:15
Sudo with a password isn't much more secure than without. In fact in someways it can be considered less secure depending on the situation. If you are in a position to use the sudo command it's fairly easy to override it in a bash profile. You can install a fake sudo that logs the password. Having the password would allow other hosts to be compromised (if they allow password logins), or other sudo commands to be run. If you allow passwordless sudo for specific commands then that isn't such an issue. One time passwords are also another possibility but you can still hijack the sudo.
â David C. Bishop
Dec 13 '14 at 22:42
1
On Ubuntu 15.04 this disallows a meaningful install, allowing literallysudo /usr/bin/apt-get install
with no parameters. If a package name is added then sudo asks for a password and gives a "Sorry..." error.
â Paul
Jun 5 '15 at 5:03
add a comment |Â
up vote
7
down vote
sudo
is exactly made for that. By editing the sudoers
file you can give users specific privileges. See the manual page of sudoers(5)
for details.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
18
down vote
accepted
Open a terminal and type sudo visudo
. At the end of the file (really the last line in it) type %yourusername% ALL=NOPASSWD: /usr/bin/apt-get install
where %yourusername% is replaced by your username.
After that you wont be prompted for a password to use sudo apt-get install
anymore but please understand this is a very risky solution, there is a reason why you need to type a password for some commands, the use of these commands without password can leave your system open for some dangers. Use with caution.
Couldsudo apt-get install
lead to problems by, for example, installing a program which doesrm -f -r /
?
â puk
Oct 31 '11 at 20:43
3
Well, no not really. And if it does you need to typesudo rm -rf /
and the instructions I gave are only to enablesudo apt-get install
, even if you enable a PPA that has that kind of code, even if you install it without really knowing what you are doing and the program tries to run he wont have access... You did not give yourselfsudo rm
permition, onlysudo apt-get install
. Its the safest approach to a insecure situation ;)
â Bruno Pereira
Oct 31 '11 at 20:50
fixed the path to the file was wrong :D the path was not /usr/sbin but /usr/bin ;) it just works
â Bruno Pereira
Oct 31 '11 at 21:15
Sudo with a password isn't much more secure than without. In fact in someways it can be considered less secure depending on the situation. If you are in a position to use the sudo command it's fairly easy to override it in a bash profile. You can install a fake sudo that logs the password. Having the password would allow other hosts to be compromised (if they allow password logins), or other sudo commands to be run. If you allow passwordless sudo for specific commands then that isn't such an issue. One time passwords are also another possibility but you can still hijack the sudo.
â David C. Bishop
Dec 13 '14 at 22:42
1
On Ubuntu 15.04 this disallows a meaningful install, allowing literallysudo /usr/bin/apt-get install
with no parameters. If a package name is added then sudo asks for a password and gives a "Sorry..." error.
â Paul
Jun 5 '15 at 5:03
add a comment |Â
up vote
18
down vote
accepted
Open a terminal and type sudo visudo
. At the end of the file (really the last line in it) type %yourusername% ALL=NOPASSWD: /usr/bin/apt-get install
where %yourusername% is replaced by your username.
After that you wont be prompted for a password to use sudo apt-get install
anymore but please understand this is a very risky solution, there is a reason why you need to type a password for some commands, the use of these commands without password can leave your system open for some dangers. Use with caution.
Couldsudo apt-get install
lead to problems by, for example, installing a program which doesrm -f -r /
?
â puk
Oct 31 '11 at 20:43
3
Well, no not really. And if it does you need to typesudo rm -rf /
and the instructions I gave are only to enablesudo apt-get install
, even if you enable a PPA that has that kind of code, even if you install it without really knowing what you are doing and the program tries to run he wont have access... You did not give yourselfsudo rm
permition, onlysudo apt-get install
. Its the safest approach to a insecure situation ;)
â Bruno Pereira
Oct 31 '11 at 20:50
fixed the path to the file was wrong :D the path was not /usr/sbin but /usr/bin ;) it just works
â Bruno Pereira
Oct 31 '11 at 21:15
Sudo with a password isn't much more secure than without. In fact in someways it can be considered less secure depending on the situation. If you are in a position to use the sudo command it's fairly easy to override it in a bash profile. You can install a fake sudo that logs the password. Having the password would allow other hosts to be compromised (if they allow password logins), or other sudo commands to be run. If you allow passwordless sudo for specific commands then that isn't such an issue. One time passwords are also another possibility but you can still hijack the sudo.
â David C. Bishop
Dec 13 '14 at 22:42
1
On Ubuntu 15.04 this disallows a meaningful install, allowing literallysudo /usr/bin/apt-get install
with no parameters. If a package name is added then sudo asks for a password and gives a "Sorry..." error.
â Paul
Jun 5 '15 at 5:03
add a comment |Â
up vote
18
down vote
accepted
up vote
18
down vote
accepted
Open a terminal and type sudo visudo
. At the end of the file (really the last line in it) type %yourusername% ALL=NOPASSWD: /usr/bin/apt-get install
where %yourusername% is replaced by your username.
After that you wont be prompted for a password to use sudo apt-get install
anymore but please understand this is a very risky solution, there is a reason why you need to type a password for some commands, the use of these commands without password can leave your system open for some dangers. Use with caution.
Open a terminal and type sudo visudo
. At the end of the file (really the last line in it) type %yourusername% ALL=NOPASSWD: /usr/bin/apt-get install
where %yourusername% is replaced by your username.
After that you wont be prompted for a password to use sudo apt-get install
anymore but please understand this is a very risky solution, there is a reason why you need to type a password for some commands, the use of these commands without password can leave your system open for some dangers. Use with caution.
edited Oct 31 '11 at 21:11
answered Oct 31 '11 at 13:45
Bruno Pereira
58k26175202
58k26175202
Couldsudo apt-get install
lead to problems by, for example, installing a program which doesrm -f -r /
?
â puk
Oct 31 '11 at 20:43
3
Well, no not really. And if it does you need to typesudo rm -rf /
and the instructions I gave are only to enablesudo apt-get install
, even if you enable a PPA that has that kind of code, even if you install it without really knowing what you are doing and the program tries to run he wont have access... You did not give yourselfsudo rm
permition, onlysudo apt-get install
. Its the safest approach to a insecure situation ;)
â Bruno Pereira
Oct 31 '11 at 20:50
fixed the path to the file was wrong :D the path was not /usr/sbin but /usr/bin ;) it just works
â Bruno Pereira
Oct 31 '11 at 21:15
Sudo with a password isn't much more secure than without. In fact in someways it can be considered less secure depending on the situation. If you are in a position to use the sudo command it's fairly easy to override it in a bash profile. You can install a fake sudo that logs the password. Having the password would allow other hosts to be compromised (if they allow password logins), or other sudo commands to be run. If you allow passwordless sudo for specific commands then that isn't such an issue. One time passwords are also another possibility but you can still hijack the sudo.
â David C. Bishop
Dec 13 '14 at 22:42
1
On Ubuntu 15.04 this disallows a meaningful install, allowing literallysudo /usr/bin/apt-get install
with no parameters. If a package name is added then sudo asks for a password and gives a "Sorry..." error.
â Paul
Jun 5 '15 at 5:03
add a comment |Â
Couldsudo apt-get install
lead to problems by, for example, installing a program which doesrm -f -r /
?
â puk
Oct 31 '11 at 20:43
3
Well, no not really. And if it does you need to typesudo rm -rf /
and the instructions I gave are only to enablesudo apt-get install
, even if you enable a PPA that has that kind of code, even if you install it without really knowing what you are doing and the program tries to run he wont have access... You did not give yourselfsudo rm
permition, onlysudo apt-get install
. Its the safest approach to a insecure situation ;)
â Bruno Pereira
Oct 31 '11 at 20:50
fixed the path to the file was wrong :D the path was not /usr/sbin but /usr/bin ;) it just works
â Bruno Pereira
Oct 31 '11 at 21:15
Sudo with a password isn't much more secure than without. In fact in someways it can be considered less secure depending on the situation. If you are in a position to use the sudo command it's fairly easy to override it in a bash profile. You can install a fake sudo that logs the password. Having the password would allow other hosts to be compromised (if they allow password logins), or other sudo commands to be run. If you allow passwordless sudo for specific commands then that isn't such an issue. One time passwords are also another possibility but you can still hijack the sudo.
â David C. Bishop
Dec 13 '14 at 22:42
1
On Ubuntu 15.04 this disallows a meaningful install, allowing literallysudo /usr/bin/apt-get install
with no parameters. If a package name is added then sudo asks for a password and gives a "Sorry..." error.
â Paul
Jun 5 '15 at 5:03
Could
sudo apt-get install
lead to problems by, for example, installing a program which does rm -f -r /
?â puk
Oct 31 '11 at 20:43
Could
sudo apt-get install
lead to problems by, for example, installing a program which does rm -f -r /
?â puk
Oct 31 '11 at 20:43
3
3
Well, no not really. And if it does you need to type
sudo rm -rf /
and the instructions I gave are only to enable sudo apt-get install
, even if you enable a PPA that has that kind of code, even if you install it without really knowing what you are doing and the program tries to run he wont have access... You did not give yourself sudo rm
permition, only sudo apt-get install
. Its the safest approach to a insecure situation ;)â Bruno Pereira
Oct 31 '11 at 20:50
Well, no not really. And if it does you need to type
sudo rm -rf /
and the instructions I gave are only to enable sudo apt-get install
, even if you enable a PPA that has that kind of code, even if you install it without really knowing what you are doing and the program tries to run he wont have access... You did not give yourself sudo rm
permition, only sudo apt-get install
. Its the safest approach to a insecure situation ;)â Bruno Pereira
Oct 31 '11 at 20:50
fixed the path to the file was wrong :D the path was not /usr/sbin but /usr/bin ;) it just works
â Bruno Pereira
Oct 31 '11 at 21:15
fixed the path to the file was wrong :D the path was not /usr/sbin but /usr/bin ;) it just works
â Bruno Pereira
Oct 31 '11 at 21:15
Sudo with a password isn't much more secure than without. In fact in someways it can be considered less secure depending on the situation. If you are in a position to use the sudo command it's fairly easy to override it in a bash profile. You can install a fake sudo that logs the password. Having the password would allow other hosts to be compromised (if they allow password logins), or other sudo commands to be run. If you allow passwordless sudo for specific commands then that isn't such an issue. One time passwords are also another possibility but you can still hijack the sudo.
â David C. Bishop
Dec 13 '14 at 22:42
Sudo with a password isn't much more secure than without. In fact in someways it can be considered less secure depending on the situation. If you are in a position to use the sudo command it's fairly easy to override it in a bash profile. You can install a fake sudo that logs the password. Having the password would allow other hosts to be compromised (if they allow password logins), or other sudo commands to be run. If you allow passwordless sudo for specific commands then that isn't such an issue. One time passwords are also another possibility but you can still hijack the sudo.
â David C. Bishop
Dec 13 '14 at 22:42
1
1
On Ubuntu 15.04 this disallows a meaningful install, allowing literally
sudo /usr/bin/apt-get install
with no parameters. If a package name is added then sudo asks for a password and gives a "Sorry..." error.â Paul
Jun 5 '15 at 5:03
On Ubuntu 15.04 this disallows a meaningful install, allowing literally
sudo /usr/bin/apt-get install
with no parameters. If a package name is added then sudo asks for a password and gives a "Sorry..." error.â Paul
Jun 5 '15 at 5:03
add a comment |Â
up vote
7
down vote
sudo
is exactly made for that. By editing the sudoers
file you can give users specific privileges. See the manual page of sudoers(5)
for details.
add a comment |Â
up vote
7
down vote
sudo
is exactly made for that. By editing the sudoers
file you can give users specific privileges. See the manual page of sudoers(5)
for details.
add a comment |Â
up vote
7
down vote
up vote
7
down vote
sudo
is exactly made for that. By editing the sudoers
file you can give users specific privileges. See the manual page of sudoers(5)
for details.
sudo
is exactly made for that. By editing the sudoers
file you can give users specific privileges. See the manual page of sudoers(5)
for details.
edited Jun 9 at 21:29
![](https://i.stack.imgur.com/E0SEH.png?s=32&g=1)
![](https://i.stack.imgur.com/E0SEH.png?s=32&g=1)
David Foerster
25.7k1361105
25.7k1361105
answered Oct 31 '11 at 12:03
Michael K
9,44011420
9,44011420
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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%2faskubuntu.com%2fquestions%2f74054%2frun-apt-get-without-sudo%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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