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)

12
votes
3answers
841 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 ...
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
13k 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 ...
11
votes
2answers
389 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
3answers
24k 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
646 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
4answers
3k 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 ...
10
votes
2answers
66k views

I want to copy a directory from one place to another via the command line

I want to copy a directory from one place to another folder. sudo cp is the command, but after that what should I type? The destination or source first?
10
votes
2answers
4k 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
1answer
870 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 ...
10
votes
1answer
3k 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
12k 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
763 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
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
375 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 ...
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
703 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
2answers
23k 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 ...
9
votes
1answer
5k 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
3answers
27k 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 ...
9
votes
3answers
18k 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 ...
8
votes
6answers
4k 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
16k 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
19k 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 ...
8
votes
2answers
14k 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
4answers
109k 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: ...
8
votes
3answers
295 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 ...
8
votes
4answers
5k 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 ...
8
votes
1answer
7k 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, ...
8
votes
1answer
530 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
3answers
7k 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? ...
7
votes
5answers
1k 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
6answers
9k 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. ...
7
votes
3answers
2k 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 ...
7
votes
1answer
9k 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 ...
7
votes
3answers
9k 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
3answers
4k 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?
7
votes
1answer
1k views

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

I read somewhere that people should use gksudo for applications that use the Gtk GUI instead of sudo? What's the reasoning for this?
7
votes
1answer
394 views

For what duration is sudo_root in “don't-prompt-for-password” mode?

The first time a user enters sudo foo, sudo_root prompts for the password. For a certain duration after that, sudo_root doesn't prompt for a password for any subsequent sudo foo's in that terminal ...
7
votes
3answers
11k 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
1answer
243 views

Why superuser don't have global menu integration? [closed]

In Unity, when running an application as a superuser, the menu is in the old-style. It's not integrated in the global menu. Why?
7
votes
1answer
222 views

How disable mysql command in sudoers file?

How can I disable /usr/bin/mysql command in sudoers file? I've tried to use it this way: %tailonly ALL=!/usr/bin/mysql But when I access user 'tailonly' of group 'tailonly', this command is still ...
7
votes
1answer
570 views

Is it safe to run a GUI program as another user?

I need to run a program (libreoffice) as another user. I noticed that the program started in the background when invoked as kdesudo -u otheruser libreoffice, possibly to avoid social engineering ...
7
votes
0answers
10k views

Can I run sudo without entering a password? [duplicate]

Possible Duplicate: How to run an application using sudo without a password? I like Ubuntu, but I hate entering a password every time when I run a command with sudo. Can I avoid it?
6
votes
2answers
4k 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, ...
6
votes
2answers
29k views

How to give nopasswd access to multiple commands via sudoers?

Below is what I know: I have to add this below line in sudoers file to give rights to the user for particular task. user_name ALL=NOPASSWD: /usr/bin/apt-get install In this case I want to give ...