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
2answers
3k 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 ...
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 > ...
55
votes
7answers
4k 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 ...
32
votes
5answers
6k views

What's wrong with using sudo?

In a comment here I've been told that unnecessarily using sudo should be avoided. While it wasn't needed in that particular case, I don't see any harm in using it. I think that when executing trivial ...
13
votes
2answers
56k 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 ...
9
votes
3answers
19k 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 ...
6
votes
2answers
30k views

Cannot connect to X Server when running app with sudo

When I am running some software using sudo command it showing error like cannot connect to X server For example if I run the following command: $ sudo gedit /etc/profile I am getting ...
15
votes
6answers
4k views

How could I list all super users?

I want a command to list all users who have root privileges i.e. sudo ? Suppose I'm a sudoer user. How could I know all other sudoer users?
6
votes
2answers
11k 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
13k views

Adding NOPASSWD in /etc/sudoers doesn't work

On 14.04 here. I SSHed into my machine, added the following line to /etc/sudoers: myuser ALL=NOPASSWD: ALL And then tried running: sudo mkdir /etc/blah ...and I'm being asked for my password. ...
5
votes
1answer
9k 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 ...
6
votes
1answer
8k 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 ...
16
votes
1answer
12k 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 $ ...
14
votes
5answers
31k 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 ...
5
votes
1answer
2k views

Changed owner of /usr/bin

I did it... I guess everyone does it sometime, but this was my first. I executed sudo chown -R /usr/bin and before I realized my mistake, it was too late... Now I can't access sudo because I receive ...
5
votes
5answers
9k 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 ...
4
votes
2answers
5k views

Why does sudo not add root's PATH with Ubuntu 12.04?

I've recently upgraded my server to Ubuntu Server 12.04. Previously it was running 11.04. Ever since then I've been having trouble carrying out root user commands through sudo. An example of this ...
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 ...
2
votes
1answer
5k views

Simple file doesn't run (command not found!)

Here in the screen shot, there is a window and terminal open. I am running on Ubuntu 10.04(kernel 2.6) LTS 64bit LiveCD session, and trying to run testDisk to recover my another formatted ...
15
votes
9answers
20k 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 ...
12
votes
1answer
15k 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.
7
votes
3answers
4k 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 ...
6
votes
1answer
26k views

“error: XDG_RUNTIME_DIR not set in the environment.” when attempting to run nautilus as root

I am attempting to run nautilus as root but when I run "sudo nautilus" from the terminal, I get the following error: error: XDG_RUNTIME_DIR not set in the environment. (nautilus:9341): ...
3
votes
3answers
1k 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
3answers
841 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 ...
1
vote
1answer
1k views

Any way to get sublime text to save settings files without running as sudo

I installed Sublime Text 2 the following way, but what I do not like about it is that I have to run it as sudo to save the user settings files. Any ways around this? Thanks, Colin sudo ...
0
votes
1answer
388 views

What is the difference between sudo X and running X as root?

My question is asking regarding a specific observation that I would like to understand. I just tried to install the package rJava in R and failed even though I prefaced the installation as suggested ...
-1
votes
2answers
329 views

Why gedit can't be used with sudo? [duplicate]

I read this answer explaining that "sometimes" root can own something at /home/$USER directory. Can anyone give an example how to prove it. Just give a test case when something really bad happens, ...
40
votes
0answers
10k views

How can I determine whether a shellscript runs as root or not? [duplicate]

Possible Duplicate: How can a script check if it’s being run as root? This is something I've been curious about. I make a lot of small bash scripts (.sh files) to do tasks that I routinely ...
14
votes
3answers
7k views

Broken sudo: can't open /etc/sudoers: No such file or directory

I have a live USB persistent version of Ubuntu 11.04 installed with Unetbootin. After some time I experienced some bugs while upgrading the kernel and trying to use my second screen on my laptop. ...
8
votes
3answers
21k 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
2answers
2k 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 ...
4
votes
5answers
23k views

Add AD Domain user to sudoers from the command line

I'm setting up an Ubuntu 11.04 server VM for use as a database server. It would make everyone's lives easier if we could have folks login using windows credentials and perhaps even make the machine ...
3
votes
2answers
637 views

Why doesn't the command do-release-upgrade doesn't require sudo?

I was wondering why the command do-release-upgrade doesn't require sudo? I mean, it does significantly change your system, so I would have guessed it requires sudo. This is from ubuntu self, but it ...
3
votes
1answer
742 views

Sudo permissions error

I am getting the following error: sudo: unable to resolve host XXX sudo: /etc/sudoers is mode 0666, should be 0440 Segmentation fault To start xampp, I typed sudo /opt/lampp/lampp start Please ...
2
votes
1answer
749 views

Correct permissions for sudo LAMP /var/www directory

I am trying to set permissions with sudo 775 - R /var/www/ on all folders and all files in the www folder of lamp for sudo user. Is this the correct way to set up the system?
2
votes
3answers
6k views

/etc/profile permission denied

I'm running an Ubuntu 12.04 LTS partition and I've recently have had issues logging in. From the GUI login screen, when I enter my username and password, it takes me right back to the login screen. ...
2
votes
1answer
3k views

Unable to launch gedit with sudo

While trying to follow these instructions, I encountered the following error while attempting what seems like a simple sudo edit operation: $ sudo gedit /var/lib/dpkg/status ** (gedit:14898): ...
2
votes
2answers
16k views

I cannot enter my password when using sudo to install Sophos AV for Linux [duplicate]

I cannot type my password as shown below. After successfully unlocking root account in Ubuntu 12.04 LTS. saintmichael@ubuntu:~$ sudo usage: sudo [-D level] -h | -K | -k | -V usage: sudo -v [-AknS] ...
2
votes
1answer
860 views

“sudo: /etc/sudoers is owned by uid 1000, should be 0”

Error: sudo: /etc/sudoers is owned by uid 1000, should be 0<br/> Segmentation fault. This comes up when trying to mount drives. USB, external drives , CD are unmountable, so I am unable to ...
1
vote
2answers
150 views

How to use sudo from a standard user?

If I try using sudo as a non-privileged user, I get a message that the user is not in the sudoers file. I know the Administrator password, but I do not know, how to use it from a non-privileged ...
1
vote
2answers
192 views

Specify password for sudo in script

I am making a script that will update my system (and do some other things, but that doesn't matter). I want the script to run sudo apt-get update and sudo apt-get dist-upgrade --yes automatically. I ...
1
vote
1answer
2k views

How can I fix “dpkg: error: parsing file”?

... and what is sudo and where/how would I type the scripts I've seen in some related answers? Yes I am very new to Linux, and am using Ubuntu 12.04 LTS. All updates are failing with ...
1
vote
3answers
18k views

sudo su fails with 'Unable to change to sudoers gid :operation not permitted.' fault [closed]

I have installed ubuntu and now I want to install flex. It asks for password but when I type my password, it asks me the password for root. When I enter the password which I had specified during ...
1
vote
3answers
2k views

When trying to install Wine on 12.10, 'Sudo' command will not let me type in a password

As the title explains, I have been attempting to install Wine on my laptop which is running 12.10. When I access the command terminal and entered sudo add-apt-repository ppa:ubuntu-wine/ppa I was ...
1
vote
4answers
405 views

Why does nothing work after I randomly changed some file permissions?

Ok so last night i was trying to set permissions to some folders in my File System, since apparently im not an admin on my own computer. And now everything got messed up today and i don't know what to ...
0
votes
2answers
103 views

How to change permission of a drive in an external hard disk?

I had an old laptop. When it got complaint I removed its hard drive and started using it as external hard disk. It has an 80 GB of memory allocation for the windows C drive partition. But now i don't ...
0
votes
1answer
114 views

block certain dangerous commands?

In my High school there are few computer having Ubuntu 14.04 installed and many students know the Root password, how can I block/disable certain dangerous commands like :- rm -rf / rm -rf * ...
0
votes
2answers
246 views

What is the root user

If you use sudo su - or sudo -s you will get the full root certification "likewise a root user ". Is this user an official user or is it from canonical? ~$ sudo su - [sudo] password for username: ...