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)

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 ...
13
votes
4answers
2k views

What is the functional difference between sudo su and sudo -i?

Why is one preferred over the other in this example? sudo su echo "options iwlwifi 11n_disable=1" >> /etc/modprobe.d/iwlwifi.conf exit Please provide links to Ubuntu documentation.
13
votes
2answers
2k views

Why am I suddenly not a sudoer anymore? [duplicate]

I booted up Ubuntu 12.10 today, and when trying to sudo, I entered my password as usual but it had said I'm not a sudoer. So I go and check my account under User Accounts, and for some reason Im now a ...
13
votes
3answers
33k views

How to configure ADB access for Android devices?

I'm using Ubuntu 12.10 and I have installed Android SDK, set it's path in my user .bashrc and it works. The problem is that my phone requires adb to be ran by root for permissions, but running adb ...
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 ...
12
votes
3answers
2k views

How to cancel the currently-applied remaining sudo time-out?

When I've just run sudo, and don't want it to remain active for the normal duration of its time-out, how can I cancel that remaining active time-out? sudo -k kills it for the current terminal ...
12
votes
1answer
14k views

What exactly does sudo apt-get -f install do?

I have seen it before. I am just wondering what exactly does it do?
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 ...
12
votes
3answers
32k views

How do I add myself into the sudoers group? [duplicate]

Possible Duplicate: How do I add a user to the “sudo” group? I've added myself back into the admin's group I think, by following this. But I still can't do commands like: sudo aptitude ...
11
votes
2answers
391 views

How come you don't need sudo privileges to update the packages list in the 10.10 Update Manager?

I have noticed that when I press the "Check" button from the Update Manager in Maverick, it starts directly downloading the information on packages without asking me my password (sudo verification) ...
11
votes
1answer
941 views

Why I have to type my password after exiting a sudo -i session?

sudo -i in the terminal will made normal user into root user & after changing into root user if we exit then again we will be back to normal user.If we try again , next time it directly takes me ...
11
votes
4answers
6k views

Setting TeX Live path for root

I have installed TeX Live 2011 vanilla and I have trouble setting the TeX Live path for root (in Ubuntu 11.10). The problem is that when I run sudo tlmgr I get: sudo: tlmgr: command not found To ...
11
votes
1answer
18k views

'sudo su -' vs 'sudo -i' vs 'sudo /bin/bash' - when does it matter which is used, or does it matter at all?

When I'm doing something that requires root be typed in dozens of times in a row, I prefer to switch my session to a root session. In the various tutorials and instructions I have used on the ...
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: ...
11
votes
2answers
693 views

I broke Sudo after an upgrade from 9 to 12.04.1

Currently sudo will prompt for a password, but absolutely nothing happens after that. No errors of any kind. I've checked the sudoers file, it passed the visudo syntax check, here's the setup: # # ...
10
votes
2answers
5k views

What does sudo service do?

As far as I know and it seems that other people have the same opinion sudo is a command that executes something with administrative privileges. However when I run rcconf I can see this line: [*] ...
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 ...
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 ...
10
votes
3answers
347 views

Is there a desktop-neutral gksudo?

There are various tools for various desktops that aim to run a graphical application as root. gksudo, kdesudo, empower, etc... But what if I'm writing a script that could be used on any Linux ...
10
votes
1answer
4k views

Is it possible to give sudo access to only a particular command?

Background: I have a development machine with LAMP setup. Several developers would access the machine from time to time. Every time they make some change in a configuration file they will need to ...
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 ...
10
votes
1answer
798 views

Why does sudo ask for a password in window after I've just authenticated in a different one?

If I am using the command line in xterm, gnome-terminal, etc., I can keep sudo from re-prompting for a password, within some limits, or I can disable it. As a compromise between usability and ...
10
votes
2answers
36k views

Sudoers file, enable NOPASSWD for user, all commands

Preface This is a fairly complex question related to the Sudoers file and the sudo command in general. NOTE: I have made these changes on a dedicated machine running Ubuntu Desktop 13.04, that I use ...
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 ...
10
votes
2answers
402 views

how to be warned if terminal has sudo privileges and also show how much time is left?

How to see in the terminal that you have sudo privileges? (so knowing I have these privileges, I can just type sudo -k) It would be better to not add too much information into the terminal also, just ...
10
votes
3answers
20k 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 ...
9
votes
3answers
2k views

Difference between cat and sudo cat? [duplicate]

Can you tell me what the difference is between cat and sudo cat? All I know so far is that cat is used for displaying contents of file and concatenation.
9
votes
1answer
909 views

How to make 'sudo' grab the password from a file?

I want to run a command that requires the sudo password say: sudo apt-get update Isn't this supposed to work (I have stored the password in a normal text file passwd.txt): sudo apt-get update ...
9
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 > ...
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 ...
9
votes
1answer
8k 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, ...
9
votes
3answers
6k views

How do I run eclipse as sudo

I've read that it's bad to run gui applications from a terminal using sudo. In order to administer some eclipse updates, I need elevated privileges (view screenshot). How do I do this correctly?
9
votes
1answer
6k views

rm: cannot remove `/run/user/root/gvfs': Is a directory

Whenever I type a command which is similar to sudo apt-get install or anything like this I get this kind of error: $ sudo su # exit exit rm: cannot remove `/run/user/root/gvfs': Is a directory How ...
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. ...
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 ...
8
votes
2answers
19k views

sudo apt-get remove does not remove config files

I'm new to Linux/Ubuntu - and I'm wondering if the behaviour I'm seeing is as designed. I have installed vsftpd: sudo apt-get install vsftpd Then I remove: sudo apt-get remove vsftpd However, ...
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 ...
8
votes
3answers
15k views

Error after sudo-ing “sudo: must be setuid root”

On a colleagues computer, everytime I use a sudo command, I get this error: sudo: must be setuid root I tried various things mentioned on the internet, like changing the permissions to 4755 from a ...
8
votes
3answers
5k views

Home folder in `root` and not in `home`… I'm confused!

I have an issue with my home folder and this are giving me some permission problems. I've installed an application that tells me that I have no permission to save in /home/username/Desktop, but in ...
8
votes
1answer
1k views

How to configure pkexec?

Reading these questions and answers: When to use pkexec vs. gksu/gksudo? Why is gksu no longer installed by default? brought me another one that will create problems for new users of that ...
8
votes
1answer
548 views

how come sudo give root privileges for a user not in /etc/sudoers?

I just wonder how sudo privileges are found with ubuntu, from a technical point of view. Users with sudo privileges are not present in /etc/sudoers, so this looks a little bit exotic. Was the source ...
8
votes
1answer
7k views

How to run a command as a user whose login is disabled?

I am trying to use the su command to run an application as another user In this case I am trying to run irssi blah@ubuntu: su - [username] irssi (enter password) blah@ubuntu: (nothing happens) ...
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 ...
8
votes
1answer
1k views

Why should I use gksudo for Gtk apps instead of sudo? [duplicate]

I read somewhere that people should use gksudo for applications that use the Gtk GUI instead of sudo? What's the reasoning for this?
8
votes
3answers
8k views

Save an edited file in nano, but no permissions

I edited a file in /etc/ that I want to save, but forgot to open it using sudo. I remember there was a command to save such a file in vi, and want to know if there is any such way to do it in nano? ...
8
votes
4answers
14k views

How can I fix broken sudo - sudo: parse error in /etc/sudoers near line 23?

I am getting this error: sudo: parse error in /etc/sudoers near line 23 sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin I was trying to disable password ...
7
votes
6answers
51k views

How can I permanently grant root access to a user? [duplicate]

Possible Duplicate: How do I grant sudo privileges to an existing user? I've been searching for the answer to this but all I find is "It's not a good idea" or "We don't recommend it" and ...
7
votes
5answers
2k views

How can I get sudo to accept my password?

I am trying to install subversion on my Ubuntu 12.04 desktop. I follow the commands to start this process, using apt-get: sudo apt-get update sudo apt-get install subversion Either of the above ...
7
votes
1answer
5k views

Cannot echo “hello” > x.txt even with sudo? [duplicate]

Possible Duplicate: sudo & redirect output I'm trying to create a file in /var/www, but even with sudo this fails: user@debVirtual:/var/www$ sudo echo "hello" > f.txt -bash: f.txt: ...
7
votes
1answer
15k views

Run a shell script as another user that has no password

I would like to run a script from the main ubuntu shell as a different user that has no password. I have full sudo priviledges, so I tried this: sudo su -c "Your command right here" -s /bin/sh ...