Questions tagged [sudo]

The sudo command allows users to run programs with the privileges of a different user (normally the root user). Use this tag for questions related to configuring and using the sudo command.

Filter by
Sorted by
Tagged with
69 votes
5 answers
80k views

How do I add myself back as a sudo user?

I clean-installed Ubuntu 11.10 today, and then installed VirtualBox. This required me to add myself to the vboxusers group, and since 11.10 seems to no longer have a graphical app to add users to a ...
Stéphane's user avatar
  • 2,526
68 votes
2 answers
186k views

allowing user to run systemctl/systemd services without password

I want the default user, ubuntu to be able to run a specific service without being prompted for a password. Specifically systemctl restart unicorn_my_app.service. Have followed the instructions here ...
MikeiLL's user avatar
  • 923
65 votes
6 answers
37k views

Why do we need to be root in terminal for shutdown and restart?

When we install/remove/update packages or make any changes which require administrative privileges we are prompted for the password of admin user who has the sudo privileges - this happens both via ...
Aditya's user avatar
  • 13.4k
64 votes
7 answers
10k views

What does `!!` mean in `sudo !!`?

I am a user of Ubuntu with not much experience and I have been using sudo. What does sudo !! do and how?
RamHS's user avatar
  • 641
64 votes
5 answers
143k 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 so that ...
zetah's user avatar
  • 9,663
64 votes
7 answers
20k 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 ...
Registered User's user avatar
59 votes
6 answers
144k views

Shutdown from terminal without entering password?

I have desktop edition of Ubuntu. I like the Terminal so that that I prefer to shutdown my computer with the shutdown command. However when I type shutdown now it prompts me to enter my password.Is ...
Santosh Kumar's user avatar
59 votes
4 answers
175k 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 ...
Hrish's user avatar
  • 2,353
56 votes
4 answers
22k 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 ...
Peter.O's user avatar
  • 24.7k
56 votes
2 answers
68k views

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

I have seen it before. I am just wondering what exactly does it do?
TheShadowFog's user avatar
55 votes
6 answers
258k views

gksu: Gtk-WARNING **: cannot open display: :0

All of the sudden gksu stopped working for me: ~$ gksu gparted (gpartedbin:24252): Gtk-WARNING **: cannot open display: :0 The same happens with gparted-pkexec: ~$ gparted-pkexec No protocol ...
d_inevitable's user avatar
  • 1,902
55 votes
9 answers
256k views

When using sudo to run pip "pip: command not found" but it's installed

sudo easy_install pip Searching for pip Best match: pip 1.4.1 Processing pip-1.4.1-py2.7.egg pip 1.4.1 is already the active version in easy-install.pth Installing pip script to /home/nyzlfc/.local/...
Rohan Naik's user avatar
55 votes
3 answers
136k 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. I'...
Joseph Wright's user avatar
54 votes
6 answers
224k views

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

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 ...
Robert Fáber's user avatar
54 votes
3 answers
97k views

How do I sudo without having to enter my password? [duplicate]

I'm trying to setup sudo without no password but still I get prompted for password, I'm using ubuntu, here is the relevant line from the sudoers configuration file : gandalf ALL=(ALL:ALL) NOPASSWD: ...
Gandalf StormCrow's user avatar
53 votes
1 answer
66k views

Use fingerprint authentication not only for login

I'm on 18.04 and have successfully enabled fingerprint login. I would like to use my fingerprint not only to login but if possible also to: Authenticate in the terminal when I do a sudo command ...
Hendrik's user avatar
  • 633
52 votes
4 answers
144k 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. ...
Zac's user avatar
  • 623
52 votes
6 answers
506k 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 some ...
51 votes
1 answer
142k views

How do I remove Ubuntu's password requirement? [duplicate]

Here are my circumstances: I am running Ubuntu 12.04. I have one user account. I absolutely hate the password requirement. How do I disable this requirement such that my Linux computer will behave ...
Melab's user avatar
  • 1,678
49 votes
2 answers
202k views

What is XDG_RUNTIME_DIR?

While I was trying to open Evince from Command line, it's giving me an error neo@Muhammad:~$ sudo evince No protocol specified ** (evince:4164): WARNING **: Could not open X display No protocol ...
Muhammad Iliyas's user avatar
48 votes
3 answers
17k views

What are the differences between sudo, su, visudo, chroot, and gksu?

What are the differences between sudo, su, visudo, chroot, and gksu ?
lambda23's user avatar
  • 3,232
48 votes
1 answer
170k views

How to install "tree" with command-line?

How do I install "tree" via apt-get in Terminal? I have been trying to do apt-get update tree but nothing seems to happen. Is it necessary to include sudo in the command?
user avatar
46 votes
3 answers
143k 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, ...
Daniel's user avatar
  • 461
46 votes
9 answers
240k 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 ...
Martin Fejes's user avatar
46 votes
12 answers
148k 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 ...
Boris's user avatar
  • 4,932
45 votes
6 answers
128k views

How to run an application using sudo without a password?

... but still be required for applications that need admin privilegies? In order to allow the following: $ apache2ctl restart httpd not running, trying to start (13)Permission denied: make_sock: ...
tutuca's user avatar
  • 2,682
45 votes
3 answers
74k views

How to umount non-sudo sshfs created directory

I used sshfs without sudo to create a directory like sshfs [email protected]:/media/user/harddrive /temp/user/harddrive but when I want to umount the /temp/user/harddrive directory with umount /...
K.Wanter's user avatar
  • 868
45 votes
5 answers
200k views

How to resolve "service start-limit-hit"

I am trying to run a Node.js API as a service, but am running into problems. When running systemctl status servicename.service I get the following error: servicename.service - [Service description] ...
Matthew's user avatar
  • 583
45 votes
1 answer
266k views

The command could not be located because '/usr/bin' is not included in the PATH environment variable [duplicate]

Can someone tell me why I get this error when I try to add a repository and what if anything I can do about it? When I try to add a repository using: sudo add-apt-repository ppa:upubuntu-com/tor I ...
user272214's user avatar
45 votes
5 answers
149k views

Do we need to reboot after adding a user to sudoers?

Do we need to reboot after adding a user to /etc/sudoers?
Ashish Karpe's user avatar
  • 2,427
44 votes
5 answers
49k views

How to NOT become a root user? Are administrators root?

I installed Ubuntu on my PC. To log in, I use the username and password I created during installation. Does this mean I am a root user? If yes, then how do I become non-root? It looks like non-root ...
FirstName LastName's user avatar
44 votes
2 answers
290k 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 update ...
oshirowanen's user avatar
  • 3,977
42 votes
3 answers
16k views

Is it possible to enter password for sudo only once, and configure it to not require for password on other terminals?

I enter my first sudo command. I enter my password. For a while, I wont have to enter my password for subsequent sudo commands. Now the question. I am someone who opens a lot of terminals. It would ...
daltonfury42's user avatar
  • 5,499
42 votes
6 answers
16k views

How is sudo safer than directly using su if the user is granted access to all commands?

So I've been reading into the differences between using su and sudo, and everyone seems to be in agreement that the sudo approach is safer than allowing access to the root account itself. They say ...
bmcentee148's user avatar
42 votes
8 answers
53k views

I need an equivalent of gksu in 18.04

I've read a lot of threads about gksu being removed from many Linux flavours, including Ubuntu 18.04. Many state that gksu is an abomination and no user should ever need to use anything like it. I ...
pastim's user avatar
  • 900
40 votes
8 answers
66k views

Nothing shows up in the terminal when I type my password

When I'm about to install a program in the terminal it wants the password: [sudo] password for xxx: But when I start to type my password nothing happens. What should I do?
Lazloinn's user avatar
  • 401
40 votes
2 answers
132k views

How to delete a swap file in Ubuntu?

I created a swap file in Ubuntu by following this process, but I no longer need it, so I would like to delete it. However, the blog article doesn't write anything regarding the deletion, so I tried ...
Blaszard's user avatar
  • 831
40 votes
1 answer
81k views

difference between gksudo and sudo? [duplicate]

Possible Duplicate: What is the difference between “gksudo nautilus” and “sudo nautilus”? I have tiny script that I want it to run on start-up, but it needs sudo ...
Untitled's user avatar
  • 1,458
40 votes
0 answers
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 do. ...
Thomas Ward's user avatar
  • 74.9k
39 votes
1 answer
99k views

adding local content in /etc/sudoers.d/ instead of directly modifying sodoers file via visudo

Can you please direct me to some examples and more detailed instruction on /etc/sudoers.d/ I'd like to give some group permission to sudo some commands, but in a proper way not to create unnecessary ...
Pawel Debski's user avatar
  • 2,724
38 votes
3 answers
8k views

After accidentally renaming /etc, how do I rename it back?

I'm using Ubuntu 18.04. I renamed the /etc folder to apache2. That was my greatest mistake Now I can't rename it back because I need to use sudo, but when I try I get the error sudo: unknown uid ...
Bipa's user avatar
  • 533
38 votes
3 answers
47k 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 command: ...
Luis Alvarado's user avatar
38 votes
3 answers
24k views

Redirect the output using `sudo` [duplicate]

I have a small question regarding using sudo with output redirect >. To enable IP forwrding, someone can use the command: echo 1 > /proc/sys/net/ipv4/ip_forward Executing this command will ...
Khaled's user avatar
  • 1,672
38 votes
6 answers
124k views

Sudo doesn't work: "/etc/sudoers is owned by uid 1000, should be 0"

When I type a sudo command into the terminal it shows the following error: sudo: /etc/sudoers is owned by uid 1000, should be 0 sudo: no valid sudoers sources found, quitting sudo: unable to ...
Rasel Khan's user avatar
37 votes
2 answers
151k views

Why don't I have a password for "su"? Problems with "sudo"

I have installed Ubuntu using the GUI, giving myself a password and everything. I do not intricately remember the process. However, what worries me is that I don't know the following password: $ su ...
Starkers's user avatar
  • 3,079
37 votes
4 answers
301k 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 following ...
Apurba's user avatar
  • 1,438
36 votes
6 answers
12k 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 ...
Jan's user avatar
  • 12.3k
36 votes
2 answers
40k 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 ...
Scott Severance's user avatar
35 votes
3 answers
200k 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 ...
kismat's user avatar
  • 351
35 votes
1 answer
93k views

Why I got 'unable to resolve host' when I do 'sudo'? [duplicate]

Whenever I do 'sudo' I get an error saying 'sudo: unable to resolve host HP-Pavilion'. I recently change my hostname to "HP-Pavilion". I wonder if I screw up something. $ sudo mkdir SourceCodePro ...
n179911's user avatar
  • 641

1
2
3 4 5
58