Questions related to the sudo command that allows users to run programs with the privileges of a different user (normally the root user).

learn more… | top users | synonyms (1)

14
votes
7answers
3k views

Nothing shows up in the terminal when I type my password

When I'm about to install a program in the terminal it wants the password: [sudo] password for xxx: But when I want to type my password it happens nothing. What should I do?
62
votes
8answers
20k 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.
22
votes
3answers
12k 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 ...
49
votes
9answers
22k 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!
219
votes
6answers
609k 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 and then login again. Is that normal? Also, can I set a newly added user as a ...
47
votes
1answer
47k 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 ...
65
votes
11answers
81k 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 ...
28
votes
4answers
55k 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 ...
19
votes
3answers
5k views

Redirect the output using `sudo`

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 ...
6
votes
4answers
35k 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 ...
64
votes
5answers
109k 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 ...
12
votes
4answers
4k views

What if I accidently run command “chmod - R” on system directories (/, /etc, …)

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 ...
63
votes
4answers
72k 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 \'+ \ ...
35
votes
2answers
3k views

Why user should never use normal sudo to start graphical application?

I've read the comunity "RootSudo" documentation and am interested in this line: You should never use normal sudo to start graphical applications as Root. Why? What is the difference? Please ...
16
votes
6answers
28k 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: ...
9
votes
3answers
21k 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 ...
60
votes
8answers
72k views

Error message when I run 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: ...
8
votes
6answers
5k 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 ...
42
votes
3answers
7k 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 ...
8
votes
3answers
10k 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 ...
15
votes
5answers
6k 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 ...
36
votes
4answers
54k views

Execute sudo without Password?

Inspired by this question.... I am the sole person using my system with 12.04. Every time I issue a sudo command; the system asks for the user password (which is good in its own way). However I was ...
26
votes
5answers
6k 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 ...
39
votes
2answers
60k 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 ...
10
votes
6answers
11k views

How can I run an application with a GUI as admin from a non-admin user session?

I defined 2 user accounts: one with admin privilege (with sudo right) => lets call it adminuser. a 2nd one without any privilege => lets call it normaluser and I configure the autologin on this 2nd ...
11
votes
4answers
140k 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: ...
23
votes
6answers
30k 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
10
votes
6answers
3k 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 ...
6
votes
2answers
4k 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 ...
37
votes
4answers
4k views

Why do we need to be root in terminal for shutdown and restart?

When we install/remove/update packages or make any changes which require administrative privileges we are prompted for the password of admin user who has the sudo privileges - this happens both via ...
40
votes
4answers
13k 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 ...
15
votes
3answers
15k views

Shutdown from terminal without entering password?

I have desktop edition of Ubuntu. I like the Terminal so that that I prefer to shutdown my computer with the shutdown command. However when I type shutdown now it prompts me to enter my password.Is ...
35
votes
3answers
4k views

What are the differences between sudo, su, visudo, chroot, and gksu?

What are the differences between sudo, su, visudo, chroot, and gksu ?
8
votes
3answers
3k 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 ...
9
votes
2answers
17k 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. ...
5
votes
3answers
16k 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 ...
21
votes
4answers
113k views

How do I grant sudo privileges to an existing user? [duplicate]

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?
12
votes
2answers
7k 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 ...
15
votes
3answers
36k 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 ...
3
votes
2answers
1k views

How can I re-instate my admin privileges?

I am running 12.04 LTS. It's a pretty default installation and is the only OS on this machine. I have two users one has administrator rights the other does not. I accidentally removed administrator ...
21
votes
3answers
32k 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: ...
10
votes
3answers
4k 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 ...
31
votes
4answers
6k views

When using sudo with redirection, I get 'permission denied'

When using sudo to allow edits to files, I regularly get 'permission denied'. For example, my mouse is jittery and sluggish, so I want to disable polling: sudo echo "options drm_kms_helper ...
13
votes
3answers
919 views

How often is the password asked for sudo commands? Where can I set it up?

I execute quite a lot of sudo commands. I noticed that if I execute one and then another one within few minutes, the 2nd time I don't get the message: [sudo] password for my_username: but I do ...
10
votes
2answers
14k 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 ...
6
votes
1answer
20k views

How do I remove Ubuntu's password requirement?

Here are my circumstances: I am running Ubuntu 12.04. I have one user account. I absolutely hate the password requirement. How do I disable this requirement such that my Linux computer will behave ...
2
votes
2answers
938 views

Graphical authentication works; why does sudo say my password is wrong?

I'm trying to install a theme, and when I enter the command sudo cp -r $HOME/Desktop/Overglossed /usr/share/themes the terminal asked for my sudo password which I entered, however I'm told my password ...
4
votes
1answer
4k views

sudo does not ask for password

Whenever I issue command sudo apt-get install foo it does not ask for password. is it because of user groups? How to make it prompt for password? Edit: My sudoers file apple@Ascension:~$ sudo cat ...
2
votes
7answers
26k views

How can I determine the sudo password? [duplicate]

What is the default password of the sudo? I visit some forums, it tells that the default password is password, but it doesn't work, how can I determine the password?
1
vote
3answers
11k views

Cannot authenticate without a password

The problem can be reproduced as follows: When I remove the password of an administrator account, "Log In without Password", I cannot use that account to authenticate. When I do something that ...