Questions tagged [sudo]

sudo is a tool which allows users to run commands as another user (usually the root user)

Filter by
Sorted by
Tagged with
0 votes
1 answer
2k views

Autofs + NFS + LDAP sudo problems

I have a setup very similar to Dan Bishop's Ubuntu 12.04 Ultimate Server Guide. I actually created a series of ansible scripts to automate this process on my github. So I have ldap+kerberos set up ...
0 votes
1 answer
2k views

After updating sudoers user still does not have access to sudo

I'm having problems adding a user to the sudoers list via the /etc/sudoers file. $ whoami iain And they said I was crazy! $ which visudo /usr/sbin/visudo $ ls -la /usr/sbin/visudo ---x--x--x 1 ...
1 vote
0 answers
164 views

Does my deploy user need to belong to the sudoer list for Upstart to start GUnicorn?

Does my deploy user need to belong to the sudoer list for Upstart to start GUnicorn? Here is the error from my Upstart log deploy is not in the sudoers file. This incident will be reported. It ...
3 votes
2 answers
3k views

Configure Ubuntu to allow ssh login via pulic/private key and sudo without password

I'm setting up a fresh Ubuntu 13.04 server. I created some users and copied their public keys for ssh authentication to their home folders. Login via password will be disabled. Everything works fine ...
0 votes
4 answers
2k views

Need to use sudo with ssh

I'm trying to run the following comamnd as user flc: sudo hg clone git+ssh://[email protected]:flc/myproject.git /opt/flc/projects/myproject However, I'm getting this error: Permission denied (...
0 votes
2 answers
2k views

NRPE Issue Unable to Read output Check_Access_Log

In NRPE running xinetd I am able to run the script locally, but NRPE reports unable to read output when trying to run it remotely. Any suggestions?: [root@travel log]# /usr/local/nagios/libexec/...
0 votes
1 answer
777 views

Configure LDAP for SUDO Support on Ubuntu Server 12.04

I'm running into some issues finishing my LDAP install. I used the following article to try the sudoers schema configured: http://ubuntuforums.org/showthread.php?t=1421998 When I run ldapadd -x -D ...
1 vote
1 answer
7k views

Accidentally deleted symlink libc.so.6 in CentOS 6.4. How to get sudo privilege to re-create it?

I accidentally deleted the symbol link /lib64/libc.so.6 -> /lib64/libc-2.12.so with $ sudo rm libc.so.6 Then I can not use anything including ls command. The error appears for any command I type ls:...
2 votes
1 answer
807 views

"sudo: no tty present" for munin plugin using password-less sudo

I am writing a plugin for munin to monitor something on our Ubuntu Linux server (which is on Amazon EC2). The plugin requires running a programme /usr/sbin/rabbitmqctl via sudo. I have the following ...
8 votes
3 answers
8k views

Running 'sudo' over SSH

I'm writing a script which is to log onto a bunch of remote machines and run a command on them. I've set up keys so the user running the script does not have to type the password of each machine, but ...
0 votes
1 answer
2k views

Root cannot move files

I'm on Debian 5, I want to move files, but I'm getting a permission denied error, even if I'm root. Do you have any solutions? -rw-rw-rw- 1 scusr scusr 49901 Jun 17 09:04 ...
3 votes
2 answers
15k views

Limit sudo to only one directory and it's subdirectories by sudoers file

So I would like to limit Apache to only change permissions in a certain folder and all of it's sub-directories, so this is what I have in my sudoers file apache ALL= (ALL) NOPASSWD: /bin/chmod -R [g+...
0 votes
1 answer
393 views

How can I sudo via a remote chained command?

I am trying to run a script which executes a chain of commands under another user on a remote server. The script contains the following ssh command to return information about the remote user's Drupal ...
9 votes
1 answer
13k views

sudo: How to allow only one argument to a command?

I want to add an entry to my suoders to allow one user to run a command with exactly one non-option argument. # tail -1 /etc/sudoers ALL ALL = (:tool) NOPASSWD: /bin/echo [a-z]* $ sudo -g tool /...
-1 votes
2 answers
1k views

su command works without prompting password

I'm on a RHEL server where the su command drops the user into root without prompting for a password. Obviously, this is a pretty big cause for concern which I'd like to fix. I'm not in contact with ...
0 votes
1 answer
414 views

visudo changes not taken into account

I added three lines to my sudo configuration, using visudo. User_Alias INSTALLERS = myusername Cmnd_Alias INSTALL_CMDS = /bin/yum, /bin/make INSTALLERS ALL = (root) NOPASSWD:NOEXEC: INSTALL_CMDS ...
0 votes
1 answer
290 views

I can't make sudo su on old version CentOS with LDAP

I configured many servers with the option to make "sudo su" with ldap users, and works fine. But in 2 servers (CentOS 5.7 and 5.5) this option show me an error: [user] is not in the sudoers file....
1 vote
1 answer
942 views

How to run sudo without Sudo installed

I do not have sudo installed on my machine, but I have a third party program which runs as different user other than root and tries to execute sudo command. Is there a way to enable this program to ...
0 votes
1 answer
233 views

How can I have a deamon invoke scripts as another user?

I am configuring a server connected to an UPS. The UPS is managed via apcupsd and it calls some scripts when there is a power outage and when the situation goes back to normal. The server is running ...
2 votes
2 answers
677 views

Upgrading from OS X 10.7 to 10.8 broke sudo

The following /etc/sudoers entry worked under Mac OS 10.7, but prompts for a password under 10.8: username ALL=NOPASSWD:/usr/libexec/dovecot/deliver I assume that Apple upgraded to a newer sudo; the ...
4 votes
1 answer
16k views

su between regular user accounts fails with "su: incorrect password"

user1 wants to su to user2 (both are non-root). When user1 runs su - user2, he's prompted for user2's password as expected, but the password is never accepted. user1@host $ su - user2 (switch ...
1 vote
1 answer
1k views

How to create a sudorule in freeIPA for the sudoedit builtin

Currently, when I want to grant some group of users access to edit a file, I proceed as follows: ipa sudocmd-add --desc=Vi IMproved default-mode, no-exec, no-suspend mode' '/usr/bin/rvim' ipa ...
0 votes
1 answer
203 views

Allow user to run script as root, but not the individual commands within the script

I don't have much experience with this type of task and realize I need to get more familiar with the sudoers file. I want a user to be able to connect via ssh and run a script that performs a bunch ...
0 votes
1 answer
202 views

Allow User Account to run a single command using SUDO privelages

I have a machine running Ubuntu 12.10. I have two user accounts setup, my account, and another user. I am able to run SUDO commands, but the other user isn't in the SUDO'ers list. What I'm trying to ...
2 votes
1 answer
4k views

Bash: php comand not found when called from a script run with sudo

I have this weird problem. The php command is not found in one specific sitiation. I try to call the command in three different ways. Only one of them fails: Being user john I create a simple script ...
3 votes
1 answer
2k views

Retain agent-forwarding in sudo

I want to be able to connect to a server, start a sudo shell, then use agent forwarding to connect to another server (in order to use SCP to copy files to a protected area). But: ubuntu@tunnelator:/...
3 votes
5 answers
7k views

How do I reset ownership of /usr/bin/sudo on Linux?

I accidentally changed ownership of /usr/bin/sudo to my current user (i also did this for some other stuff in my /usr directory). I can't change any of them back because I need ownership of /usr/bin/...
1 vote
1 answer
691 views

sudo group member privileges in the sudoers file

I've just installed sudo on my machine (Debian Wheezy). While I was editing the sudoers file using visudo, I noticed this line: %sudo ALL=(ALL:ALL) ALL On several tutorials and blogs (although ...
0 votes
1 answer
2k views

sudoers nopasswd switch user and run node not working

I'm trying to prevent a password prompt on a command that runs node as the www user by adding the following line to the bottom of my /etc/sudoers file: gituser ALL=(ALL) NOPASSWD: /usr/bin/sudo -u ...
0 votes
1 answer
434 views

Recommendations for bootstrapping Ubuntu server

When I create new Ubuntu 12.10 instances, I typically bootstrap them by manually SSHing onto the machine and editing the sudoers to put a NOPASSWD on the default user (e.g., ec2-user, azureuser, etc.)....
-2 votes
2 answers
117 views

How do I report vulnerability in sudo? [closed]

I have found a vulnerability in sudo and I was able to reproduce it on multiple instances of xubuntu. It didn't seem to work on debian. How do I report it properly? I have read so much about ...
4 votes
4 answers
431 views

Disabling ssh as root on Linux boxes and the challenges of writing scripts

It's a common suggestion from security-minded people to disable ssh as root on Linux boxes. My question is this: Let's say you normally write lots of scripts which ssh to a large number of Linux ...
1 vote
1 answer
1k views

Allow normal user to run PHP script as root using SUDO

How can I allow a normal user on Ubuntu to run php scripts? sudo php /path/to/script/script.php Basically the script needs to be run as root but the users does not have root privileges on their ...
3 votes
1 answer
2k views

Trying to use sudo with bash subshell: env variables not working

I have read a few other posts, it appears cumbersome to do multiple commands within sudo. Heredocs suffer from limitation of not being able to do redirection of stdin/stdout. Here in any case is a ...
0 votes
4 answers
2k views

I modified sudoers file and I no longer have any users who can sudo

I uncommented a line that says all users in the admin group are sudoers and I think that caused my problem. I'm pretty sure I corrupted the file or something. I would show what the sudoers file looks ...
0 votes
1 answer
15k views

How to set up SUDO rights for execution of Python script from PHP [closed]

I run Raspbian Wheezy on my Raspberry Pi, and i want to call a Python script from PHP. That all works great (i call 'exec python go.py' from php) but now i want to call a script which needs root ...
2 votes
1 answer
5k views

Setup RHEL/CentOS 5 to use SUDO in command line and X

How do I make CentOS/RHEL prompt me for my password (and not roots) when I run a privileged command. I have found many guides that detail how to do this for the command line but I want it to work ...
3 votes
3 answers
2k views

Can't use sudo without password on Ubuntu 12

Maybe my question is stupid but I'm really stuck... My OS is Ubuntu 12.04 My sudoers: # # This file MUST be edited with the 'visudo' command as root. # # Please consider adding local content in /etc/...
0 votes
1 answer
690 views

Default user not in sudoers file

In Debian 6, right after my installation. I try to run a command as root, only to find out that my account isn't in the sudoers file. This is from the main user account that is set up under ...
12 votes
1 answer
13k views

How do I set both NOPASSWD and SETENV on the same line in sudoers?

In the sudoers file, how can I use multiple Tag_Specs on the same line. Normally if I don't want to ask for a password I will do something like this: who where = (aswhom) NOPASSWD: commands I want ...
0 votes
2 answers
1k views

CentOS lost Root Access

For some reason I cannot access my root user via SSH. It displays the error on login: could not open session. However I happen to have another user account that is a normal non-sudo user. Is there ...
13 votes
2 answers
2k views

Allow complex sudo command on Debian Linux

I need to allow a specific command on a Debian Linux box for a single user. I've tried this in the /etc/sudoers file: # User privilege specification zabbix ALL=NOPASSWD: /usr/bin/apt-get --print-...
5 votes
1 answer
1k views

sudo does not preserve TMPDIR

The sudo manpage tells me, that I can preserve the environment by passing the -E option, which does not work in the case of $TMPDIR: > env | grep TMPDIR TMPDIR=/localdata/tmp > sudo env | grep ...
-1 votes
1 answer
1k views

running script containing sudo in cron [duplicate]

#!/bin/bash value=$(<man.txt) echo "$value" if [ "$value" == "true" ]; then echo "startedif_manthan" ps -ef|grep sym |awk '{ print $2 }'|sudo xargs kill -9; sleep 30; sudo sh /...
0 votes
1 answer
370 views

copying files using non-root rsync

I have a primary server and a secondary server and I wish to copy files over from the primary to the secondary using rsync. I have mounted the primary disk onto the secondary using NFS and am copying ...
0 votes
2 answers
2k views

Sudo seemingly not obeying -S parameter

I am running some scripts as part of pre/post deploy using DeployHQ, I need to be able to call the script on one line and for there to be no feedback from the terminal so I want to pass the password ...
-2 votes
2 answers
80 views

setting up sudo account

I want to create a managed account with root powers and the ability to su as root if need be to manage the box without needing root. What is the correct way to do it? Does this work? /usr/sbin/...
0 votes
1 answer
257 views

OpenLDAP How to give sudo access to a limited set of machiines only

I am trying to setup an LDAP server for multiple machines. I want to have an account which only has sudo access in a some machines, not all. Will having a multi-valued sudoHost in a SudoRole solve ...
0 votes
2 answers
442 views

sudoers file errors on solaris (suspecting wildcards)

I'm trying to write a universal sudoers file to control permissions for all our users across all our environments and I've been using the wildcard for the hostnames like so (all data has been ...
0 votes
1 answer
116 views

Can't access directory of another user after giving equivalent access to both

I've edited the /etc/sudoers file through visudo and added www-data ALL=(git) NOPASSWD: ALL git ALL=(www-data) NOPASSWD: ALL so now the user "git" should be able to execute ...

1
11 12
13
14 15
18