sudoers is the default configuration file to store sudo security policies governing the rights of users to run commands with elevated or alternate permissions.

learn more… | top users | synonyms

0
votes
1answer
27 views

sudo : wildcard in user/group name

I try to find a solution about a sudo problem. I need to push different sudoers files on different servers, depending on the users present on the servers. But I would like to know if I can avoid that ...
-2
votes
0answers
19 views

amazon linux yum update changed sudo root permissions [migrated]

I ssh'ed into my server, ran sudo yum update, and now I'm asked for a password to sudo anything. Looking back through update logs, I noticed this: /etc/sudoers.d/cloud-init saved as ...
2
votes
0answers
22 views

For sudo su - to retain SUDO_* environment variables?

We have a number of script (for Openstack operations) which require privileged execution in our environment. For some of the scripts we'd like to refer back to the USERNAME or UID of the person who ...
1
vote
2answers
39 views

Linux: How to allow a regular user to “su - anotherUser”?

I wrote a Nagios check script which checks if user peeradmin is able to touch a file in some mount on the server. Nagios user is: nagios . I've edited /etc/sudoers and added these lines but none ...
-1
votes
1answer
43 views

How to deny a specific user to reboot or shut down with sudo [duplicate]

Hello and thanks for helping me in this question. I just have in /ets/sudoers something like this: # User Aliases User_Alias CLIENT = jhonny CLIENT myserver = ALL. !ADMIN_CMD,!SU I just want deny ...
0
votes
1answer
41 views

Monitor root commands issued by users

I tried to log the commands issued by the system administrators in our organization and its output using sudo plus the log_output directive as follows on the visudo file Defaults env_reset ...
0
votes
1answer
99 views

ubuntu sudoers file hacked?

I've 3 ubuntu 14.04 vm on a remote hosting for code repository and testing purpose. I've got them for more than 1 year now. Two of them are working properly, but on one of them I can't run root ...
1
vote
0answers
45 views

What is a safe alternative to wildcards in /etc/sudoers?

In the /etc/sudoers file on my Red Hat server, I have this line: %webdevgroup ALL=NOPASSWD: /bin/chmod * /home/http/* This is clearly a bad idea, since someone could do something like this: sudo ...
0
votes
2answers
38 views

Execute bash script as root from normal user

I am trying to execute a bash script as root from a normal user. The story behind is that I need the www-data user to be able to kill a specific process. To avoid having apache being able to go mayhem ...
0
votes
3answers
66 views

How to grant user modify only specific protected file by sudo

I need to grant user modify some files by sudo that have only read-only access. For example, I want to grant user 'hosteditor' modify '/etc/hosts' file. I added to sudoers follow line: hosteditor ...
-1
votes
1answer
172 views

How to make sudo -u not require password [closed]

I'm using ansible with vagrant and ansible is trying to sudo as postgres user to run some postgres commands. Ansible running as vagrant user seems to run something like sudo -u postgres psql This ...
-1
votes
1answer
78 views

How to pass the SSH_AUTH_SOCK through sudo (Permission denied (publickey).) [duplicate]

I have a Ubuntu server with the users: ubuntu and user I connect to each of the users using ssh -A (to pass my local machine keys to SSH). From any of the users I can connect to the SSH server of ...
0
votes
1answer
304 views

Setting up Sudo in CentOS-7

In CentOS 6.5, i would do the following to setup sudo for users - useradd -G wheel -c "John Smith" jsmith visudo uncomment this line - %wheel ALL=(ALL) ALL usermod -G wheel -a jsmith restart ...
0
votes
1answer
84 views

Visudo Gives no Error but asks “What Now?”

I'm trying to add a new sudoers file using sudo visudo -f /etc/sudoers.d/abe . I added the contents: # Allow automatic update of abe matt ALL=(root) NOPASSWD: python /home/matt/token-abe/setup.py ...
0
votes
2answers
204 views

Sudo without password issue

Having a problem with sudo. As the user forge I want to be able to run sudo service php5-fpm reload without having to type a password. I've tried all of the variants below. forge ALL=NOPASSWD: ...
-2
votes
1answer
75 views

create file with sudo but have ownership as current user [closed]

I am on centos 6.5. I have a limited user. I gave the user some specific rights via sudoers. Lets say its user1. I want user1 to create a file in a directory where he has ownership. Therefore I run ...
-2
votes
3answers
137 views

Enable Passwordless Sudo with Arguments

I am trying to enable passwordless sudo for updating yum on a RHEL box. I have the following line in sudo visudo. myuser ALL=(ALL) NOPASSWD: /usr/bin/yum update After doing this under myuser I am ...
3
votes
1answer
436 views

sudo still ask for password when NOPASSWD is used

I read all sudo posts on serverfault, but I still cannot figure out what I'm doing wrong. Normally I finally find the solution but not this time : I want apache user to be able to execute this ...
7
votes
1answer
252 views

Linux/Unix - /etc/sudoers - host definition

can anybody tell me in which case the sudo host definition is useful? I mean this part of a line in the sudoers file: bob host1 = NOPASSWD: reboot In which environment (except sudo via LDAP) do I ...
2
votes
2answers
109 views

Configuring sudo to not prompt for password on non-allowed commands

There is plenty of information on how to make sudo not prompt for passwords (NOPASSWD). Let's say I have user alice, and this line in my sudoers: alice ALL=(root) NOPASSWD: /bin/myadmintool This ...
13
votes
3answers
508 views

Which method to use for granting sudo

What is the difference between adding a user to /etc/sudoers and usermod -a -G sudo? Which method should be used for granting sudo?
1
vote
4answers
253 views

How do I use saz-sudo puppet module to deploy my own sudoers file with hiera?

I have saz-sudo installed and have created a site_sudo module based (I hope) on it. Here's what I have in my site_sudo/manifest/init.pp file: class { 'site_sudo': } sudo::conf { 'web': ...
1
vote
4answers
556 views

Fedora, ssh and sudo

I have to run a script remotely on several Fedora machines through ssh. Since the script requires root priviliges, I do: $ ssh me@remost_host "sudo touch test_sudo" #just a simple example sudo: no ...
1
vote
1answer
208 views

Sudoers NOPASSWD how to grant access to a specific ln command

In /etc/sudoers I need to grant passwordless sudo for this command: /usr/bin/env sudo ln -nfs /home/deployer/apps/myapp_staging/shared/config/nginx.conf /etc/nginx/sites-enabled/ to the deployer ...
2
votes
3answers
5k views

nagios nrpe unable to read output

I'm trying to use check_nrpe to check on a remote server, but it's not working and I can't figure out what am I missing... # /usr/lib/nagios/plugins/check_nrpe -H XXX -c check_load -a 6,5,4 8,7,6 ...
-1
votes
1answer
378 views

How to set “sudoers” in nsswitch.conf on Solaris-11

I am doing this on Solaris 11. When i open '/etc/nsswitch.conf' i see this - ... sudoers: files ... I would like to change this to - ... sudoers: files ldap ... I tried editing the file ...
42
votes
8answers
4k views

Is it OK to set up passwordless `sudo` on a cloud server?

Sorry if the question is vague but I don't know a better way to ask and I didn't see the caveats/tradeoffs of the approach discussed here. I love the idea of accessing servers via keys, so that I ...
2
votes
1answer
177 views

mongodb 2.4.9 is crashing on wheezy when running as root

I installed mongodb-10gen v2.4.9 on a debian Wheezy, and I'm having this really weird behavior: if I run it as root I can't get it starts: root@xx:~# /etc/init.d/mongodb stop [ ok ] Stopping ...
2
votes
4answers
136 views

program needs to be run as root by any user and can be located anywhere

I have some program called foo that needs root privileges when it executes. foo needs to be able to be run by any user and can be located at any path. The reason this program can be at any path is ...
2
votes
2answers
180 views

remove specifying the full path in sudoers

I am trying to add a NOPASSWD entry for 'sudotest.sh' (or any script/binary that requires sudo) in my /etc/sudoers file (redhat) but in order to make it work, I must specify the full path. The ...
2
votes
1answer
290 views

User not in sudoers, but still can use sudo

I have a user user1 that is not in the sudoers file (nor belonging to groups in sudoer) but can still use sudo. How is it possible ? user1~$ groups user1 www-data My sudoer conf ...
0
votes
1answer
81 views

Sudo Command Alias option equivalent in OpenLDAP

I have an OpenLDAP installation that manages Sudo as well. Everytime I create a sudoers role, I have to list the commands that that sudoers role can run. This leads to a lot of repetition. Is there ...
2
votes
1answer
124 views

Strange PATH when use sudoers via ldap

I have a working LDAP authentication environment. LDAP server is on ubuntu 12.04 machine while client are all centos 6.4 machines. Recently I configure sudoers in LDAP following this article ...
2
votes
1answer
80 views

sudoers entry allowing group to run as group with no password

I want to add an entry to sudoers that will allows users in the group test to run any command on any host as the group test (i.e., with sudo -g test, without having to type a password. I've tried a ...
4
votes
1answer
3k views

Using FreeIPA for centralized sudo - using SSSD for sudoers

I have setup FreeIPA for centralized sudo and all is working well with the exception of being able to use SSSD for sudoers. If I have in my client /etc/nsswitch.conf the following: sudoers: files ...
3
votes
1answer
522 views

Using FreeIPA for centralized sudo - how to specify ALL commands?

I'm having a hard time wrapping my head around FreeIPA's model. The FreeIPA manual states: FreeIPA adds an extra control measure with sudo command groups, which allow a group of commands to be ...
-2
votes
1answer
65 views

How to edit sudoers file in ubuntu [closed]

I accidentally changed the mode of the file /etc/sudoers and added a line to the file. Now every time I want to "sudo", I got a error message like "parse error in /etc/sudoers near line 21" I ...
-1
votes
1answer
537 views

sudo su - <username> should be possible but sudo su - shouldn't be for sudo user

There is a requirement I got. My sudo users (for which their entry in sudoers file) should be able to access other user's account say Oracle using following command: sudo su - Oracle The above ...
0
votes
1answer
102 views

Executing a command as apache

This script keeps outputting a 1. and I cannot understand why. <?php passthru("nohup sudo rndc reload sd.example.com",$op); print_r($op); ?> I have also tried the above code ...
2
votes
4answers
217 views

User with root privileges to restart a service can't

I want a user to be able to restart the php5-fpm service. In visudo, I have the following: username ALL=NOPASSWD: /etc/init.d/php5-fpm When I su to the user and run sudo /etc/init.d/php5-fpm stop, ...
0
votes
2answers
83 views

many unknow process name as “sudo”

my server free memoney is less and less, And many process COMMAND are"sudo" when use top and enter M. I don't understand root user need to use "sudo". I want to know the way these processes are ...
-1
votes
1answer
306 views

sudo to other user doesn't preserve DISPLAY variable

I've got an /etc/sudoers file that works just fine in all versions of Fedora prior to F18, but we've noticed that when upgrading to F18 (and installing FreeIPA, though the cases I'll show here were ...
0
votes
0answers
40 views

visudo passes syntax check but the file fails when put into place

I've been trying to create a modified sudoers file in /etc/sudoers.d/ but am having trouble. visudo -cf /file/path shows no syntax issues, but when i mv /tmp/sudoers/ /etc/sudoers.d/sudoers sudo ...
2
votes
1answer
3k views

sudo still ask for password when NOPASSWD is used

I want to run this script (it is post-receive hook of git repository): #!/bin/sh echo "Executing post-receive hook as user `id` using `which sudo`" sudo -l sudo -n bash ...
1
vote
4answers
636 views

How to fix sudoers file on virtual machine without root and reboot

I've broken my sudoers file on a heavy loaded server with a syntax error. And unfortunately I've lost my root password. The server is critical and I'd like to avoid rebooting. So, no sudo, no root, no ...
2
votes
1answer
254 views

sudo: PAM audit_log_acct_message() failed: Permission denied

.. any time I'm run sudo through NRPE, I'm get a following message in my /var/log/secure, and I can't figure out how to resolve it. sudo: PAM audit_log_acct_message() failed: Permission denied ...
0
votes
4answers
586 views

How to make bash script executable for a user, but not readable

I'm trying to run a script at login that will execute for a regular user, but not be readable by that or other non-root users. I've tried various things including chmod/chown combinations, as well as ...
3
votes
1answer
401 views

Adding group to sudoers has no effect

I'm trying to grant the www-data group access to certain commands under sudo (ie to restart Apache) and I'm having no luck. I spent the majority of Friday looking into this issue and must have looked ...
-2
votes
1answer
60 views

sudo -u … -i doesn't preserve a user's PATH

I'm trying to determine a user's path when I'm root, but sudo, even with the -i flag, doesn't seem to replicate the user's environment correctly. Is this some sudoers policy setting? $ sudo bash # ...
1
vote
1answer
146 views

With sudoers, how can I allow a user to change the group of files/folders within their home directory?

I have a webserver where apache runs as www-data. Users are set up using chef, and some of their file/folder permissions are set to group: www-data, e.g. uploads folders. Deployments are done with ...