The sudo command is a program for some Unix and Unix-Like operating systems, that allows a user to execute programs with the security privileges of another user. Typically those of a superuser or the root user.

learn more… | top users | synonyms

12
votes
3answers
30k views

How to check if I have sudo access?

I recently got into trouble because of this. $sudo vim /etc/motd [sudo] password for bruce: bruce is not in the sudoers file. This incident will be reported. Is there a way to check if I have ...
0
votes
1answer
12 views

Changing date on Ubuntu without sudo privilages

I am trying to automate a time change on Ubuntu 10.04 with a bash script using the date command. The script works, but it requires sudo privileges, however, the user who will execute the script does ...
0
votes
0answers
37 views

sudo - /etc/sudoers is world writable on Ubuntu OS

By mistake I change the permission of /etc/sudoers file on Ubuntu OS, now when applying any command using sudo, its giving error, sudo: /etc/sudoers is world writable sudo: no valid sudoers sources ...
0
votes
1answer
20 views

I removed the sudo,the I have no permission to install any program?

It's seems like a big problem. I can't login as root, because I use the fedora20, and I can not use sudo. What can I do now ?
7
votes
5answers
17k views

How to reset folder permissions to their default in Ubuntu?

I recently typed the command sudo chmod 777 -R / after that some things like sudo -i are not working normally. So I am wondering if there is any way I could reset the folder permissions to their ...
2
votes
1answer
11 views

'Syntax error' while setting sudo.conf askpass variable with visudo

I want to set askpass program for sudo, i've made file /etc/sudoers.d/path-askpass with following content: # Path to askpass program Path askpass /usr/bin/ssh-askpass File was edit with visudo, ...
48
votes
9answers
63k views

sudo with password in one command line?

On busy days, I'd like to run $ ./configure && make && sudo make install && halt on the night and go to bed, hoping the application would automatically be installed. But ...
2
votes
2answers
1k views

How can I alias a command for sudo?

I have an alias that I would like to use both as a regular user and as root, via sudo. Specifically, it is this: alias rm=trash This works fine as a normal user, and it works fine when I use sudo ...
0
votes
1answer
70 views

sudo cp with wildcard syntax doesn't do anything in Linux

I have a directory containing files that are owned by root, from this directory I wish to copy all the files ending with errorAll to another directory. My wildcard syntax is correct because performing ...
4
votes
4answers
3k views

Xforwarding doesn't allow for switching users

I'm ssh'd into a remote computer and xforwarding is working fine... but as soon as I "sudo su -" or "sudo su user2" it no longer Xforwards anything giving me the error: X11 connection rejected ...
5
votes
1answer
738 views

Linux/Unix - how to enable one user to `sudo` without a password

How can a user be setup to sudo (or su -) without entering a password?
2
votes
3answers
3k views

Ubuntu: Getting sudo access as guest

I installed Ubuntu Linux 12.04 a little while ago to try it out and play around with it (hence I have no idea what I'm doing). I tried changing my home directory by editing the /etc/passwd file, ...
0
votes
1answer
13 views

Strange behavior when sudo -u

I'm trying to set up daily backups of my postgres database. To that end I've created a /home/backups directory, and inside it the /home/backups/postgres directory. The owner of /home/backups/postgres ...
0
votes
0answers
7 views

How to make an exception in a pam module?

I have 2 servers: A and B. I want A to connect to B via ssh (as a non-root user) to run a sudo command. But sudo on B requires a yubikey input to allow the command: auth required pam_yubico.so ...
4
votes
1answer
653 views

sudo -E not passing all variables

Reading the man pages I expected sudo -E to pass all environment variables to the subshell, but I am not getting the expected results. As expected, awesome: $ export ...
0
votes
1answer
40 views

Running opera as a different user in linux

I am trying to run multiple opera instances as different users simultaneously in linux mint. I have done it with firefox in the past using the sux command like sux user1 firefox But if i try that ...
3
votes
2answers
669 views

Can I have sudoedit check `$EDITOR` like visudo does?

As far as I know, the major difference is that visudo has a simple parser for seeing if /etc/sudoers (and other sudoers files) is goodly; however, I also noticed that, when I set EDITOR=emacs, ...
2
votes
1answer
615 views

Set default editor for crontab -e invoked with sudo

I'm using Bash on Debian Squeeze. I just read this topic: change default text editor for crontab to vim I have exported both variables VISUAL and EDITOR to vim for normal user and for root. And this ...
0
votes
1answer
14 views

Suse root group not having root rights?

I am in the root group of a suse machine but when I use sudo -u <myAccount> ... I get a Root privileges are required for... a few terminal commands: $ cat /etc/sudoers: ALL ALL=(ALL) ...
0
votes
2answers
47 views

Broken sudo on Google Compute Engine

Error : [ri@myinstance-1 etc]$ sudo su - sudo: >>> /etc/sudoers: syntax error near line 120 <<< sudo: parse error in /etc/sudoers near line 120 sudo: no valid sudoers sources found, ...
2
votes
3answers
5k views

sudo make install: permission denied

I have a most annoying question about building from sources. I've searched for an answer for a long while and nowhere can I find one... I've compiled software from sources before and this just baffled ...
0
votes
1answer
277 views

Messed up /usr/ directory in Ubuntu. Can't sudo!

In ubuntu 11.04 I seem to have messed up the permissions/ownership of the /usr/ directory. It won't let me sudo -s to fix them! sudo: must be setuid root and I can't login as root because I'm on ...
0
votes
2answers
66 views

how to undo sudoers file

I accidently command the root admin and sudo in sudo visduo file. Now with current user it is not rolling it back because i can't access it any more. File does not get opened with command sudo visudo ...
2
votes
1answer
101 views

sudo su “username” vs. su “username”

Please explain me, what is the difference between: sudo su "username" vs. su "username" Which has higher privileges? If I log into root with sudo su "username", I am root for one command only? So it ...
22
votes
3answers
53k views

Command: sudo su -

I understand what su - does logs you into root with the root environment (as opposed to su which logs you into root with your environment) And I understand what sudo does you are root for one ...
1
vote
2answers
138 views

How to run command without “sudo”?

Nagios on my server isn't working properly. It can't execute command lftp without "sudo". Is there a way how to allow nagios run commands without using "sudo"? My /etc/group: ...
10
votes
5answers
7k views

Running docker as sudo

I installed boot2docker and the i run ./boot2docker start export DOCKER_HOST=tcp://localhost:4243 so i started the tutorial from their docker site. I don't understand one thing: when i run ...
3
votes
0answers
2k views

'user is not in the sudoers file' but actually is

I have already read a lot of posts about enabling sudo-access for a specific user but those couldn't help me so far. The situation is: I'm running Debian Testing. On the system there are only two ...
0
votes
5answers
49 views

My user information was deleted [duplicate]

Possible Duplicate: Undo an “rm -rf ~” command? So I made a stupid error, I did a sudo rm -rf of my ~/ directory. I wasn't thinking of the hidden files in there. Now instead of showing what ...
1
vote
1answer
23 views

force sudo to forget password immediately after exit everytime

If I execute sudo su, I am asked for my password ( [sudo] password for ... ) After do some stuff, I can leave this root mode with exit. If I execute again sudo su, I will not be asked for a password ...
3
votes
2answers
58 views

What makes the differences between `sudo CMD` and `sudo su` followed by `CMD`?

I have an SSH server with key only auth and I want to add a key for a new user. I log in with one user(kidmose), I try to append the key to a new user's(remote) authorized_keys and it fails: ...
2
votes
1answer
127 views

OpenWrt: Cannot install package sudo

I have installed the latest OpenWrt Chaos Calmer r42871 on my TP-LINK WR-842ND router. And everything's good except the problem: root@router:~# opkg install sudo Unknown package 'sudo'. ...
1
vote
2answers
2k views

Can't install Parallels Tools on Debian 7.2.0

(Parallels Desktop 9, latest version) As per instructions, I switch to root: $ su - root $ whoami root $ echo $EUID 0 and then execute the installer: $ cd /media/cdrom0 $ ./install and I get ...
0
votes
1answer
31 views

output of sudo -l confusing me

(habdbsync) NOPASSWD: ALL, (habdbsync) !/bin/sh, !/bin/ksh, !/bin/csh, !/bin/tcsh, !/bin/zsh, !/bin/bash, (habdbsync) !/bin/su, (habdbsync) !/usr/bin/ssh, !/usr/bin/scp, !/usr/bin/slogin (root) ...
0
votes
1answer
355 views

su- no password entry for user? installing powerline with pip

I am trying to install Powerline using pip to do the installation. I'm installing in to /usr/local/lib/python2.7/dist-packages/powerline using the su -c "pip install github******" and get the response ...
0
votes
1answer
73 views

Replacement for “su user_with_sudo; sudo -s” for user without sudo-rights?

Let's say I have two user accounts: user (without any sudo permissions) user_with_sudo (with all sudo permissions) Now, I'm logged in as user but want to do something as root, e.g. switch to a ...
10
votes
4answers
3k views

How can I properly set sudo/visudo's editor?

I am using Ubuntu 10.04 Server and trying to set up sudoers to respect a user's EDITOR choice (within limits) In my sudoers I have: Defaults editor=/usr/bin/nano:/usr/bin/vim Defaults ...
0
votes
1answer
652 views

Cannot change the desktop wallpaper in Ubuntu 14.04

I tried installing GNOME packages to Ubuntu 14.04(unity). I used these codes. sudo apt-get install gdm sudo apt-get install gnome-shell sudo apt-get install ubuntu-gnome-desktop ...
0
votes
0answers
48 views

Sudo suddenly not working correctly on OS X?

I have started noticing that commands requiring the use of sudo on OS X Mavericks are failing, e.g. I just updated Meteor and it couldn't write the launcher script sudo cp ...
0
votes
0answers
12 views

How to run a zle widget from an alias

I am using the sudo plugin for oh-my-zsh, which usually is bound to (Esc) (Esc). However, I'd prefer an alias for sudo !!. The plugin actually defines a zle widget, but how can I call this widget ...
1
vote
0answers
37 views

Adding group permissions with sudoers with NOPASSWD still prompting for password

Fedora 20, clean install. I added the following lines to my sudoers file with visudo: %power ALL=NOPASSWD: /sbin/shutdown I then created group "power" and added my account to this group. ...
3
votes
3answers
7k views

sudo: Sorry, user root is not allowed to execute

This command fails on OpenSuSE 11.4: root@host# sudo -S -u "coreapp_customer1_d" -g "coreapp_customer1_d" /bin/bash -l -c "mkdir -p /home/coreapp_customer1_d/.ssh" with this message: Sorry, user ...
7
votes
7answers
20k views

Sudo - is there a command to check if I have sudo and/or how much time is left?

(Originally posted on Stack Overflow. They suggested I try here instead. Here's the original post: ...
4
votes
3answers
2k views

sudo without password when logged in with SSH private keys

Is it possible to make sudo command to support SSH private keys, so that when the user logins using a private key then he/she could sudo without typing a password. This would allow storing the UNIX ...
0
votes
1answer
74 views

Are there downsides to installing node.js with root privileges?

I'm using the following code to install node: cd /usr/local/src/ wget http://nodejs.org/dist/v0.10.25/node-v0.10.25.tar.gz tar -xvf node-v0.10.25.tar.gz cd node-v0.10.25 ...
2
votes
3answers
123 views

Using su - (user) to open privileged port not working

So I wanted to run a Node server on port 80 but I didn't want to run the entire process on root privileges, for security I thought this would be the best. So I thought a good solution would be to use ...
1
vote
0answers
43 views

Is there anyway you can restrict users from executing a command with another name?

I'm not asking an obvious question here. I would like to elucidate with an example. A user 'bob' is always executing 'chmod 777 /home/bob/impfiles' so that user 'alice' could make changes to the ...
1
vote
3answers
135 views

When copying directories with sudo it copies just the first level of its hierarchy

This question was also asked here. When I copy some directory (dir) recursively with sudo in bash it copies just the first level of the dir hierarchy, but when used without sudo it copies the dir ...
0
votes
0answers
92 views

When copying folders with sudo it copies just the first level of folder's hierarchy [closed]

When I copy some directory (dir) recursively with sudo in bash it copies just the first level of the dir hierarchy, but when used without sudo it copies the dir with all its subdirs, though commands ...
1
vote
2answers
90 views

Running Screen after switching users

After switching users (with su) I cannot run screen: % screen -L Cannot open your terminal '/dev/pts/5'. How can I run screen after switching users?