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)

8
votes
1answer
9k 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
1answer
567 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
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?
8
votes
3answers
9k 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
3answers
13k 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
2answers
17k views

sudo: unable to resolve host ubuntu-server

I have a problem with sudo. Every time when I trying to use sudo I got this problem: sudo: unable to resolve host ubuntu-server My /etc/hosts file: 127.0.0.1 localhost 127.0.1.1 ...
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
4answers
8k views

How to avoid prompt password for sudo?

I know I can go root (super user) via the su command but I have to authorize it after firing the commands. Is there a way I can go root and authorize (with password) in one line
7
votes
4answers
29k views

sudo: source: command not found

I've been updating some of the default profile for bash, and saw from the tutorials I was following that I could reload the new profile with the new environment settings by using: source ...
7
votes
4answers
14k 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 ...
7
votes
2answers
18k views

No password prompt at sudo command

Whenever I issue command sudo apt-get install ** it does not ask for password, not in my admin user too. How to make it prompt for password? My sudoer : ubuntu:~$ sudo cat /etc/sudoers # # This ...
7
votes
1answer
324 views

How can I change the number of password entry attempts allowed by sudo?

By default, sudo prompts me to input my user password a maximum of three times if I input wrong password. How can I change it to unlimited times(?)? How can I make it so that it asks me for my ...
7
votes
1answer
882 views

How to check if sudo password has been entered for this terminal session?

As said in the headline, I need to check if the sudo password has been entered for this terminal session in a shell (aka, if I have sudo rights now). If I have it, I would like to do one thing and if ...
7
votes
5answers
2k views

Change sudo timeout under fish

I want to change sudo timeout, so I edit sudoers via visudo (as adviced in many tutorials online) to the following form: Defaults env_reset , timestamp_timeout=20 root ALL=(ALL:ALL) ALL %admin ...
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 ...
7
votes
1answer
444 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
2answers
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 ...
7
votes
1answer
3k views

How to use a python virtualenv with sudo?

I am trying to make a python environment separate from the system one (using virtualenv) in a directory which is not under /home, because I need to use it to build other software that has to be ...
7
votes
2answers
9k views

Root's .bashrc not executing on sudo -i

On one of my Ubuntu 11.10 servers, when I use sudo -i to become the root user, root's .bashrc is not being executed. On all other servers, whose relevant configurations are identical as far as I know, ...
7
votes
1answer
261 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
295 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
632 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
7answers
2k views

Is the command `sudo rm /Desktop/filename` safe?

Is this safe to use? sudo rm /Desktop/FILENAME The reason for wanting to use sudo is I can't see the file. I accidentally typed in sudo rm /Desktop/index.html. It didn't find it but could ...
6
votes
2answers
5k 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
1answer
6k 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: ...
6
votes
4answers
46k 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 ...
6
votes
2answers
5k 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 ...
6
votes
4answers
32k views

how to remove symbolic link

i was doing sudo ln -s /usr/share/phpmyadmin /var/www/phpmyadmin but i accidentally typed something else. So now I want to correct it but it says symbolic link already exist. Please help, Thanks in ...
6
votes
1answer
688 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 ...
6
votes
1answer
3k views

sudo su doesn't change users for mysql

Last night, on my server, I did: sudo su - mysql to change to the mysql user so I could run the mysql client, which is set up so it will only authenticate from the mysql account. I successfully ...
6
votes
6answers
3k views

Disabling shutdown command for all users, even root - consequences?

I would like to disable the shutdown command for all users, even root, on an Ubuntu Server installation. The reason I want to do this is to ensure that I don't get into the habit of shutting down the ...
6
votes
2answers
2k views

How can I ensure the `snd-hda-intel` module is loaded on startup?

I need to type sudo modprobe snd-hda-intel in order to get my sound card to work. What config file do I need to edit and what edit should I be looking to make so I can get the sound driver loading ...
6
votes
1answer
5k views

Errors followed by command “Sudo nautilus”

I have opened Nautilus with root power to delete some items.When I typed Sudo nautilus,the particular window opened up,but some errors also came along with it as following: meego@meego-Notebook-PC:~$ ...
6
votes
2answers
292 views

To be granted root rights while browsing files/directories with Nautilus 2.30

I'd like to know if there a way to be granted root rights while using Nautilus 2.30 ? For example I'd like to move some old folders of long unused users from the home directory - remains of previous ...
6
votes
1answer
193 views

How do I safely run a graphical application as a normal user while root?

We often talk about using gksu, sudo -i and pkexec to run things as root while a normal user but I'm facing the opposite problem today. The script I'm using is running as root. I need it to start a ...
6
votes
3answers
5k views

Run script as root at login (no sudoer user, shell session)

Much like /etc/profile and ~/.profile but ran by root instead of the user is doing login. /etc/rc.local runs after boot but I need running the script before login. The user is not a sudoer one. ...
6
votes
1answer
221 views

Lost sudo privileges [duplicate]

Last night I was working on installing vsftpd on my Ubuntu 12.10 server. I shutdown last night and when I booted up this morning I seemed to have lost the abilities to sudo anything. It just says, "** ...
6
votes
1answer
1k views

Opening terminal asks for sudo password

Whenever I open a new terminal within 12.04, I am prompted to enter my sudo password. Why is this happening?
6
votes
2answers
915 views

How do I work around sudo 'segmentation fault' on basic bash commands?

I am sure the answers are out there, but alas there are too many answers (here and elsewhere) to other questions stopping me from finding them. I just encountered something substantially similar to ...
6
votes
1answer
229 views

Access to /dev/ttyUSB0 and sudo

This is my first question here. I am running Ubuntu 12.04 and have an application accessing the USB port of computer. My Ubuntu username is gadu. Until today, i've always used the following command: ...
6
votes
2answers
488 views

Sudo commands are run without entering the root password, how to stop this?

I haven't edited my sudoers, but I don't have to enter the password when running a sudo command line in the terminal. I can run any sudo command without entering the password, how can I stop this ?
5
votes
3answers
854 views

Why is this by passing the SUDO password?

I have a bash script I am using to automate a SVN checkout. The contents of the file were: #!/bin/bash cd /var/www-cake sudo svn checkout file:///usr/local/svn/bash_repo/repo/ Then when I double ...
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
5answers
1k views

Should I use “sudo” before “make install”?

I am installing the latest FFmpeg from this guide: In some places it suggests performing make install without sudo, here is a single example of several: cd ~/ffmpeg_sources wget ...
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 ...
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 ...
5
votes
2answers
18k views

Can I add myself to group `root'?

$ id uid=1000(kev) gid=1000(kev) groups=1000(kev),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),109(lpadmin),124(sambashare) $ ls -l /etc/sudoers -r--r----- 1 root root 723 Jan 31 2012 /etc/sudoers ...
5
votes
4answers
103k views

how to use sudo command to install .tar.gz? [duplicate]

Possible Duplicate: How to install a .tar.gz (or .tar.bz2) file? I am newbie to ubuntu. I would like someone to explain how to use sudo command to unzip & install .tar.gz file to me.
5
votes
2answers
1k views

How do I make a sudo command start at start-up with a 1 minute delay?

I would like to make a sudo command (sudo service smbd restart) run after 1 minute of being logged on. How would I go about doing this? P.S. This is a system with no monitor, mouse, keyboard or ...