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)

11
votes
2answers
17k 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 ...
3
votes
3answers
7k views

Can't open Gedit as root

When I run sudo gedit /path/to/some/random/file I get the following error ** (gedit:6262): WARNING **: Command line `dbus-launch --autolaunch=7f8731869e1c690b8205727e0000000a --binary-syntax ...
2
votes
2answers
2k 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 ...
5
votes
1answer
3k views

I accidentally removed myself from sudoers, how can I fix this? [duplicate]

I have one admin account and recently I have accidentally added myself to a single group (usermod -G without -a). So, I am not in the sudoers file any more. However, it is not possible to log in to ...
6
votes
4answers
13k views

How do I fix a “E: The method driver /usr/lib/apt/methods/http could not be found.” error?

I tried updating my packages from the terminal and this is what I got: $ sudo apt-get update E: The method driver /usr/lib/apt/methods/http could not be found. E: The method driver ...
5
votes
1answer
7k views

How to solve “sudo: /etc/sudoers.d is world writable”

How can I fix the following error with sudo? /etc$ sudo sudo: /etc/sudoers.d is world writable usage: sudo [-D level] -h | -K | -k | -V usage: sudo -v [-AknS] [-D level] [-g groupname|#gid] [-p ...
3
votes
3answers
6k views

How do I run an executable file with a double click?

I'm trying to run an executable (testdisk) but double click doesn't work. The only way is to run: sudo ./testdisk from terminal. But I'd like to open executables with double click in future. How ...
23
votes
5answers
46k views

How to launch application as root from Unity Launcher?

Mainly I am looking for a way to pin an application to the Unity launch bar, and run it as root. Currently, even if I start the application with sudo, and pin it after it starts, it will start as ...
69
votes
9answers
6k views

Run same command again but as root

Sometimes when I run a command I don't notice that I needed to run it as super user to have enough permission. Is there a way to run the same command again but as a super user?
17
votes
4answers
7k 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 ...
14
votes
2answers
6k views

warning message at command line `sudo`

Everytime I try to sudo something at the terminal, I get a warning message: alexandre@XPS-15Z $ sudo mount file.iso /mnt/ -o loop [sudo] password for alexandre: no talloc stackframe at ...
23
votes
8answers
6k views

Why it is sudo?

Why we use sudo to perform a terminal command as an administrative, why it isn't admin or something else, is there a reason for sudo?
6
votes
1answer
626 views

How to configure pkexec to not ask for password?

I have a GUI application that needs to call a daemon (written in Python) with superuser privileges. I would like to do this without prompting the user for a password. Since the daemon is a script, I ...
12
votes
3answers
3k 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 ...
2
votes
3answers
9k views

'sudo' not working after changing the permissions of '/usr' directory

Recently I had to change the folder permissions of /usr folder. Now the whole sudo is not working. If I try to update my system using this command: sudo apt-get update I get the following message: ...
11
votes
3answers
23k 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 ...
10
votes
2answers
6k 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: [*] ...
11
votes
1answer
1k 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 ...
6
votes
1answer
10k views

Enable passwordless sudo as a specific user

I have two users on my system: itsadok, my main user, and elasticsearch, a user with a different ulimit for running ElasticSearch. I would like to be able to run stuff as the secondary user without ...
1
vote
1answer
567 views

Running a program as another user without typing a password

I'm trying to mark my browser internet traffic with a DSCP by selecting the packages with a certain owner. In order to do that I have to start my browser with a dummy user. I start my browser by ...
12
votes
1answer
16k views

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

I have seen it before. I am just wondering what exactly does it do?
10
votes
1answer
9k 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
2k 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?
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, ...
4
votes
2answers
2k views

Standards accounts are able to get root access using sudo without password request

I have installed a particular software using the installer present using the command sudo ./install.sh. After the installation now all the accounts on my ubuntu laptop can gain root access by ...
3
votes
3answers
30k views

How to run applications as root?

I am having some strange issue with Kate and Kwrite. When I click on Open File, it crashes with segmentation fault. I am a complete newbie to Linux, and I think the issue is that I am not running ...
30
votes
1answer
38k 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 ...
34
votes
2answers
9k views

Aliases not available when using sudo

I was playing around with aliases today and I noticed that aliases don't seem to be available whilst using sudo: danny@kaon:~$ alias alias egrep='egrep --color=auto' alias fgrep='fgrep --color=auto' ...
13
votes
2answers
2k views

Why do I need root privileges to umount a drive at the command line, but not in nautilus? How to change?

When I insert a thumb drive, media card, or USB hard drive, to unmount it via the command line, I need to use sudo umount /media/the_device But, I can unmount the device in a file manager like ...
15
votes
3answers
43k 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 ...
10
votes
1answer
2k 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 ...
9
votes
4answers
2k 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 > ...
54
votes
7answers
3k views

Can sudo be reinstalled after being removed?

This seems to be a chicken-egg problem. The most common task using sudo is installing and removing software. sudo apt-get purge <appname> But sudo itself can be removed. sudo apt-get purge ...
8
votes
3answers
16k 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 ...
5
votes
1answer
8k views

how to shutdown a linux machine, including the root password, in 1 line?

How do you include the root password, say for shutting down an ubuntu machine? like, sudo shutdown now is it possible to include the password on this 1 line? like an extra parameter? reason for ...
25
votes
3answers
12k views

Why doesn't `sudo cd /var/named` work?

I want to cd into /var/named but it gives me a permission denied error, and when I want to use sudo to do this I am not permitted. What is the technical reason for this, and is it possible to do this ...
5
votes
2answers
8k 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 ...
5
votes
3answers
14k views

Mounting filesystem with special user id set

I want to mount the device /dev/sda3 to the directory /foo/bar/baz. After mounting the directory should have the uid of user johndoe. So I did: sudo -u johndoe mkdir /foo/bar/baz stat -c %U ...
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 ...
4
votes
5answers
6k views

Always Sudo Privileges

I've searched for this, and the answer is probably in a million places on the 'net, but I can't find it... How do you give your account root privileges in Linux so that you don't need to sudo every ...
15
votes
1answer
10k 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 $ ...
15
votes
9answers
17k 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 ...
7
votes
3answers
3k views

How to run a Desktop graphical application just once under sudo?

For example, I'm trying to run Archive Manager from Ubuntu Desktop (10.04) under sudo otherwise it won't let me extract a Software Development Kit into /usr/local Update: I don't want sudo to be a ...
4
votes
1answer
699 views

Can't login to my account, I know the password

I use Xubuntu 14.04 64 bit. I was watching a movie, the desktop froze (as usual duh!), I logged out using a terminal, and couldn't log in to my account after that, I'm using a terminal. I type my ...
4
votes
1answer
6k views

Remove sudo privileges from a user (without deleting the user)

If you give a user sudo privileges how can I remove the sudo privileges and make the user become just a regular user? I used: sudo adduser username sudo Now I've changed my mind.
4
votes
1answer
5k views

How to allow execution without using the sudo?

I am writing a Java application where i need to do a command line execution and get a result back, but when i execute the command, it ask for sudo password. So far i tried: $ sudo -s $ vim ...
3
votes
3answers
977 views

How to make sudo remember my password and how to add an application to startup

I guess this should be a simple thing for ubuntu users out there. I have two questions. Whenever I need to run some command that requires permission from root, I run as sudo followed by that ...
2
votes
1answer
281 views

Block a command from sudo user

I don't need an administrator to change my root password. I don't want any sudo user to execute this command: sudo passwd $root I have tried it in the sudoers file using the following command: ...
2
votes
3answers
643 views

Ways to run Nautilus with elevated privileges [duplicate]

What are the differences between the following ways to run Nautilus with elevated privileges: a) sudo nautilus b) gksu nautilus c) gksudo nautilus Which should I use?
2
votes
1answer
1k views

Ubuntu 11.10 with KDE installed does not prompt for elevation for privileged ops in all apps

I installed the KDE window manager on top of Ubuntu 11.10 and while I am using KDE, I do not get an elevation dialog when I try to perform tasks that require root privileges. Instead, the operations ...