Questions related to the sudo command that allows users to run programs with the privileges of a different user (normally the root user).
10
votes
3answers
6k views
How do I add myself back as a sudo user?
I clean-installed Ubuntu 11.10 today, and then installed VirtualBox. This required me to add myself to the vboxusers group, and since 11.10 seems to no longer have a graphical app to add users to a ...
42
votes
8answers
8k views
How to avoid using sudo when working in /var/www?
I want to stop having to use sudo everytime I work in /var/www. How can I do that? I simply want to put all of my sites into this directory and work with them without too much pain.
31
votes
9answers
11k views
What is the difference between “gksudo nautilus” and “sudo nautilus”?
I've been using gksudo nautilus and sudo nautilus through Alt+F2.
What's the difference? They look very similar!
85
votes
4answers
187k views
How can I add a new user as sudoer using the command line?
After I add a user using adduser, I can't see it via System->Administration->Users and Groups unless I logout then login again. Is that normal?
Also, can I set a newly added user as a sudoer or ...
36
votes
10answers
30k views
How to modify a invalid /etc/sudoers file? It throws out an error and not allowing me to edit again
How do I edit an invalid visudo file?
Here is what happens:
$ sudo visudo
>>> /etc/sudoers: syntax error near line 28 <<<
sudo: parse error in /etc/sudoers near line 28
sudo: no ...
12
votes
3answers
3k views
sudo & redirect output
I have a small question regarding using sudo with output redirect >. To enable IP forwrding, someone can use the command:
echo 1 > /proc/sys/net/ipv4/ip_forward
Executing this command will ...
25
votes
5answers
34k views
How do I add a user to the “sudo” group?
In /etc/sudoers I see this:
# Allow members of group sudo to execute any command after they have
# provided their password
# (Note that later entries override this, so you might need to move
# it ...
9
votes
6answers
8k views
How to run an application using sudo without a password?
... but still be required for applications that need admin privilegies?
In order to allow the following:
$ apache2ctl restart
httpd not running, trying to start
(13)Permission denied: make_sock: ...
40
votes
4answers
20k views
How do I sudo a command in a script without being asked for a password?
I want to turn my system on automatically every day. So I use the below code in my Python script, but sudo asks me for a password every time:
os.system('sudo sh -c "echo date \'+%s\' -d \'+ \
...
14
votes
4answers
18k views
Difference between “su”, “sudo -s”, “sudo -i”
I already read it from manual but I can't see difference..
su - change user ID or become superuser
sudo -s [command]
The -s (shell) option runs the shell specified by the SHELL environment ...
6
votes
3answers
9k views
Mount VirtualBox SharedFolder in Ubuntu VM on boot
I have a Ubuntu VM running in VirtualBox.
I have a Shared Folder set up as myshare
I have a folder created in my home directory (~/jamesw) as host.
using the line sudo mount -t vboxsf myshare host ...
6
votes
6answers
2k views
What are the benefits of sudo over su?
What is the actual benefit that ubuntu (or debian derivatives) achieve by disabling root user.
Everywhere I read, its says to prevent unintentional damages for inexperienced users.
I want to know ...
10
votes
6answers
2k views
Why can't non-admin users install software?
This is probably something I don't understand since I am used to Windows
and am only starting out with Ubuntu. I know that software in linux comes in packages what I don't understand is why can't ...
5
votes
2answers
2k views
Regain Sudo rights after removing from admin group [duplicate]
I accidentally removed myself from the admin group when editing the user. Now I can no longer use sudo. The error says: ber is not in the sudoers file. This incident will be reported.
I booted up ...
25
votes
5answers
2k views
Why is gksu no longer installed by default in 13.04?
I have always recommended pressing ALT+F2 and typing for example gksu nautilus or gksudo nautilus both are equivalent; to run graphical programs with root privileges. However, I have just installed ...
9
votes
3answers
2k views
su command + authentication failure
I am having problems with the su command. I know my password and I am typing it correctly but su indicates authentication failure.
So I checked on the internet and then went into recovery mode and ...
3
votes
2answers
28k views
How do I login as root?
I want to login as root, but when I enter
sudo -s
and enter password, this message is shown: "you are not in sudoers file", and when I enter
su
and enter password, this is shown: ...
24
votes
3answers
3k views
When to use pkexec vs. gksu/gksudo?
There are two general ways to run applications graphically as root (or, more generally, as another user). Programs like gksu, gksudo, and kdesudo are graphical frontends for sudo. In contrast, pkexec ...
16
votes
1answer
9k views
How do I run specific sudo commands without a password?
On one particular machine I often need to run sudo commands every now n then.
I am fine with entering password on sudo in most of the cases.
However there are three sudo commands I want to run ...
25
votes
4answers
6k views
What is the difference between the 'sudo' and 'admin' group?
I noticed that two groups are granted similar-looking permissions in /etc/sudoers:
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute ...
4
votes
3answers
4k views
How to fix sudo after “chmod -R 777 /usr/bin”?
I enetered chmod -R 777 /usr/bin and now sudo is not working.
It is giving error that sudo must be setuid root.
On looking via Google, some advice said to run chown root:root /usr/bin/sudo
chmod ...
7
votes
4answers
1k views
What if I accidently run command chmod
I accidently ran
sudo chmod 755 -R /
instead of
sudo chmod 755 -R ./
I stopped it after few seconds, but now there is some problems such as
sudo: must be setuid root
How can I revert ...
23
votes
5answers
2k views
How to NOT become a root user? Are administrators root?
I installed Ubuntu on my PC. To log in, I use the username and password I created during installation. Does this mean I am a root user? If yes, then how do I become non-root? It looks like non-root ...
20
votes
5answers
17k views
sudo error, is mode 0777, should be 0440
I am getting sudo errors, how do I fix this error?
sudo: /etc/sudoers is mode 0777, should be 0440
sudo: no valid sudoers sources found, quitting
17
votes
3answers
11k views
sudo: unable to resolve host (none)
I have this issue on AWS on some servers. Whenever I run sudo the terminal is stuck doing seemingly nothing, until it finally spits out this error message. My terminal looks like this:
...
4
votes
6answers
2k views
How can I run an application with a GUI as super user from a normal user session?
I defined 2 users:
one with admin privilege (lets call it admin) with sudo right.
a 2nd one without any privilege (lets call it normaluser)
and I configure the autologin on this 2nd user normaluser.
...
8
votes
4answers
21k views
How do I grant sudo privileges to an existing user?
I want to grant a newly created user sudo privileges in Ubuntu.
I tried
sudo adduser hduser admin
but it says no admin group exists.
How can I do it?
7
votes
1answer
9k views
My main username is not in the sudoers file.
I was trying to install some software/edit files with my main username(not root)
But I got this error [X] is not in the sudoers file. This incident will be reported.
I tried to edit the /etc/sudoers ...
7
votes
2answers
4k views
How do I prevent PolicyKit from asking for a password?
For years, I've had the following in my sudoers file:
scott ALL=NOPASSWD: ALL
For those who don't know, this prevents sudo and friends (gksudo, etc.) from asking for a password. However, over the ...
5
votes
3answers
858 views
sudoers - simple explanation requested
Everytime I want to be able to run something that requires me to be a sudoer too many times, I need to google for the formatting of /etc/sudoers to remind me again what exactly is the proper way to ...
33
votes
7answers
22k views
How do I install Sublime Text 2?
I installed Sublime Text 2 on 12.04 as per this tutorial.
However I don't have adequate permissions when launching the program from the Unity launcher. For example I cannot install packages, or if I ...
7
votes
1answer
4k views
Cannot lock '/etc/group' in recovery mode
I've currently booted into recovery mode, because I removed my sole user from admin :/
When I run adduser oadams admin, I get gpasswd: cannot lock /etc/group; try again later.
For what it's worth, ...
7
votes
2answers
4k views
Environment variables when run with 'sudo'
As example to my question, my ~/.bashrc file contains this lines:
> export LD_LIBRARY_PATH=/opt/intel/mkl/lib/ia32:$LD_LIBRARY_PATH
> export LD_PRELOAD=/opt/intel/mkl/lib/ia32/libmkl_core.so
...
1
vote
2answers
4k views
Setting the PATH so it applies to all users, including root/sudo
The instructions in How do I set PATH variables for all users on a server? work to set the PATH for all 'normal' users. However, if I do sudo -s and then printenv PATH the updated path is not shown. ...
0
votes
5answers
10k views
'Some index files failed to download' while updating
When running sudo apt-get update I get these following errors:
Err archive.ubuntu.com quantal InRelease
Err archive.ubuntu.com quantal-updates InRelease
Err archive.ubuntu.com quantal-backports ...
28
votes
3answers
2k views
What are the differences between sudo, su, visudo, chroot, and gksu?
What are the differences between sudo, su, visudo, chroot, and gksu ?
35
votes
3answers
5k views
How can I determine whether a shellscript runs as root or not? [duplicate]
Possible Duplicate:
How can a script check if it’s being run as root?
This is something I've been curious about. I make a lot of small bash scripts (.sh files) to do tasks that I routinely ...
9
votes
2answers
3k views
How to prevent system applications (like the Software Center) from asking for password?
I'd like Software Center, Update Manager and some other system management applications to work without asking for password (like sudo does if configured with NOPASSWD) but only asking for a ...
8
votes
4answers
1k views
Why does echoing these parameters with sudo not work? [duplicate]
Possible Duplicate:
sudo & redirect output
These are suggestions given by powertop to save energy:
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
echo 1 > ...
13
votes
4answers
2k views
Is the difference between sudo and gksu the same as the difference between sudo -i and sudo -s?
Is the difference between sudo cmd and gksu cmd, the same as the difference
between starting a shell with sudo -i and sudo -s?
... or put another way,
Is sudo cmd the same as sudo -i cmd
and gksu ...
15
votes
1answer
14k views
How to run sudo command with no password?
How does the ubuntu user on the AWS images for Ubuntu Server 12.04 have passwordless sudo for all commands when there is no configuration for it in /etc/sudoers?
I'm using Ubuntu server 12.04 on ...
7
votes
2answers
11k views
How do I sudo without having to enter my password?
I'm trying to setup sudo without no password but still I get prompted for password, I'm using ubuntu, here is the relevant line from the sudoers configuration file :
gandalf ALL=(ALL:ALL) NOPASSWD: ...
8
votes
2answers
8k views
Disable sudo permission to user from command line
I have activated root user in ubuntu and want to use ubuntu as server with no DE. For this I want to disable sudo privilege given to first user. How can I do this from command line ? I know I can use ...
4
votes
2answers
2k views
Problem installing ruby and gems
I just installed ruby using apt-get with the following command:
sudo apt-get install ruby1.9.1-full
But when I try to do sudo gem install ... it says that I have not installed gems and that I shoud ...
3
votes
6answers
7k views
Password not working for sudo (“Authentication failure”)
Before I mention anything further, DO NOT give me a response saying that terminal won't show password input. I'm AWARE of that.
I'm typing my user password in (not a capslock issue), and for some ...
2
votes
2answers
3k views
Run apt-get without sudo
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 ...
11
votes
1answer
7k views
What exactly does sudo apt-get -f install do?
I have seen it before. I am just wondering what exactly does it do?
11
votes
8answers
9k views
How to run an Application as another user?
I use krusader for file management stuff. the problem is that apache's DocumentRoot should be under chown www-data:www-data /path/to/www. so using krusader (which is run under my account) I've not ...
6
votes
1answer
4k views
“sudo cd …” one-liner?
Occasionally I want to cd into a directory where my user does not have permission, so I resort to sudo.
The obvious command sudo cd somedir doesn't work:
$ sudo mkdir test
$ sudo chmod go-rxw test
$ ...
5
votes
2answers
2k views
Password not working in Graphical Applications (gksu)? Works with sudo
I am having a problem where when I try to run say GParted, when I am prompted for a password, it says "Incorrect Password"
But when I enter the same password using terminal sudo gparted for example, ...


