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

learn more… | top users | synonyms

-4
votes
1answer
18 views

Why isnt this sudoer command run as root?

I want to give PHP access to a very specific script using a configuration under /etc/sudoers.d. So I did the following: visudo -f /etc/sudoers.d/99-php And entered this sudo rule: www-data ALL = ...
0
votes
2answers
24 views

How to fix sudo file on EC2

I managed to save my sudoers file with a syntax error so now I can't do sudo -i any more on my EC2 instance. This effectively locks me out of root account since the only way to get root access on EC2 ...
1
vote
0answers
29 views

NFS local user mapping works, but not with sudo

I want to use an NFS share for backing up. I have created a local user on the client with a specific uid/gid combination that works for writing files to the NFS share. So far so good. However, I need ...
8
votes
1answer
233 views

su: /bin/bash: Resource temporarily unavailable

Unable to switch user to postgres. Ulimit settings for postgres user is set with reasonable limits. We are not hitting max. No errors in /var/log/messages. Error: BETA -bash-4.2# sudo su - ...
0
votes
0answers
17 views

Pulling Read restricted files from a remote system with rsync and sudo

A remote system generates statistics files every 5 minutes and places them in a certain directory. At any given time there are 1000+ files in that directory. Every 5 minutes I want to copy the ...
0
votes
1answer
36 views

What is causing visudo to fail with: “visudo: can't stat <filename>: Bad file number”?

We use the #include feature in the sudoers file for organizing our sudo rules on a per-application basis. Our sudoers set up looks kinda like this: /etc/sudoers -> #include ...
0
votes
1answer
23 views

how to assign read only permission to sudo group

how can I assign read only permission to all users who are entitled in sudoer file? I want to assign the permissions on log files to those who are in sudoer file.
-1
votes
1answer
32 views

amazon ec2 linux redhat server install unar package

I'm just trying to install unar package for the purpose of uncompress compressed files. What I've tried is sudo yum install unar But it shows "No package unar available". I googled and downloaded ...
-4
votes
6answers
94 views

Sudo immediately after login asks for password [closed]

If you think about it, it is kind of silly that sudo asks for your password even if you just logged into the machine and entered your password. I realize that sudo and /bin/login are two entirely ...
12
votes
4answers
1k views

Giving access of a set of commands to a non-root user without sudo

I want to give non-sudo access to a non-root user on my machine, there is a user dns-manager, his only role is to run all the BIND commands(rndc, dnssec-keygen) etc. Now everytime he has to run a ...
0
votes
1answer
44 views

Granting sudo access for specific command and any flags set (RedHat)

How can you grant sudo access for a specific command with flags. Ex. I requested sudo access for this command below: sudo /usr/bin/su - wassa /usr/was7/profiles/dmgr/bin/wsadmin.sh I can run the ...
2
votes
1answer
160 views

How to trigger sudo's grace period for a given user via Puppet?

I am trying to deploy the Redmine server via Puppet. The installation procedure uses Bundle to install its dependencies. When being installed interactively, sudo prompts user for password when Bundle ...
0
votes
1answer
45 views

How do I create files in directory owned by user in same group without sudo?

I have created a user to own website files (drupal) and added that user to www-data, so essentially all files are drupaluser:www-data. I want to go in and put the site in to git but I get permission ...
1
vote
0answers
148 views

Sudo error: effective uid is not 0, is sudo installed setuid root? (sudo executable is already root/root 4755)

Running /usr/bin/env sudo /etc/init.d/httpd restart on a godaddy vps works fine from the shell. The same command executed remotely via capistrano generates the following error: sudo: effective uid is ...
3
votes
1answer
379 views

Cron job as root need to sudo to another user [duplicate]

RHEL6 In root's crontab a have: * 21 * * * /root/script.sh In script.sh there is a line: /usr/bin/sudo -u jira bash -c 'cd /opt/jira/bin; ./stop-jira.sh' && echo "Jira Shut Down" >> ...
0
votes
0answers
59 views

Slow sudo response

We have LDAP setup to provide information regarding sudo. The whole system works, but it takes a long time (~10 seconds) for any sudo command to return. For instance if I run strace -f -r -o ...
0
votes
1answer
148 views

sudo and --ask-sudo-pass on CentOS 6.6

I'm running command: [kamil@server.com ]# ansible example.com -a "sudo id" --ask-sudo-pass sudo password: example.com | FAILED >> { "failed": true, "msg": "[sudo] password for kamil: ...
0
votes
1answer
26 views

FreeTDS - sudo uses different protocol version

After a while of fiddling with FreeTDS I got my connection to MSSQL from Sphinx up and running as DSN-less connection. After running indexer index Everything works as expected. But, after ...
0
votes
0answers
42 views

Using placeholders or environment variables in sudoers

Is it possible to use in sudoers rules any kind of placeholders (not just wildcards) or environment variables? What I would like to do is to verify that user (the one sudoing a command) passes as an ...
0
votes
1answer
44 views

Can't change folder ownership via SSH

For some reason, I have a folder that I cannot read nor change its ownership. If I do a ls command, this is what I get: drwxrwxrwx 4 myusername myusername 4096 Jan 26 20:35 media1 <--- OK ...
2
votes
1answer
632 views

Running Ansible task as a specific user

I am trying to run a specific Ansible task as a different user than the one who is running the playbook. My .yml file looks like this: --- - hosts: staging_servers tasks: - name: check ...
0
votes
1answer
104 views

sudo: unable to execute … bad address - what is it and how to fix it?

I have a set of scripts which finishes up client machine deployment after executing a fairly generic NetRestore image. The main script runs under root privileges, and then calls another, "user" ...
0
votes
1answer
58 views

Can I use serverspec on a remote system without requiring root or sudo access on that system?

Main thing I am trying to do is to run the tests from an unprivileged user (a gui runs these tests) without giving away the keys to the castle if this user gets compromised. Most of the tests ...
1
vote
1answer
199 views

Ansible SSH as one user and Sudo as another

I am having trouble with configuring Ansible and sudo to allow me to SSH into a server and run a command as another user. I have gone through the questions / answers below and the Ansible ...
1
vote
1answer
34 views

Starting lighttpd from nagios renders lighttpd broken

I'm using Debian 7.8 (wheezy), and lighttpd 1.4.31 with nagios 3.4.1. when I start lighttpd normally (as root), everything works as expected: /etc/init.d/lighttpd start However, when nagios starts ...
1
vote
1answer
65 views

Slow sudo and ssmtp (hosts file wrong?)

I'm running an Ubuntu Server 12.04.5 LTS and when I type sudo su it takes 30+ seconds to open the shell. Searching on internet, this problem seems related to the file /etc/hosts and /etc/hostname. ...
3
votes
2answers
751 views

Ansible Fails to Authenticate Sudo Even When Sudo Pass is Given

Problem Using the latest, stable Ansible build, I have an odd problem where my playbook hangs on one server during "Gathering_Facts" but works fine on other similar servers when using Sudo. On the ...
0
votes
1answer
125 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
73 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 ...
0
votes
2answers
94 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 ...
3
votes
1answer
105 views

SE Linux - can't change SELinux booleans with sudo

I think this is the correct place to put this, rather than in StackOverflow Either way, we have a CentOS 6.6 server. SElinux isn't allowing us to enable httpd_can_sendmail I've tried this.... sudo ...
0
votes
1answer
73 views

Sudo-io log output shows garbled text

We have set up in our servers sudoers config the following configuration in order to log the console output for auditoring purposes Defaults:%administrators log_output Defaults logfile=/var/log/sudo ...
-1
votes
1answer
58 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
77 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
160 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
147 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
146 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
314 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 ...
2
votes
1answer
81 views

Regular and repetitive sudo alerts from several Linux hosts

I've got several hosts running CentOS 5.11 on the LAN. Lately we've been getting fairly regular sudo alerts (via email) from attempted sudo commands by non-authorized users. Been Googling in case the ...
0
votes
2answers
417 views

Allow sudo user to install packages from CentOS GUI

I've installed GUI on CentOS 6.5 with yum groupinstall basic-desktop desktop-platform x11 fonts but now when I attempt to use GUI Package Manager (Add/Remove software) to install packages, it asks ...
-1
votes
1answer
912 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 ...
2
votes
0answers
82 views

Slow authentication on Fedora VM due to /var/run/dbus/system_bus_socket connect timeout

I have this Fedora VM that for some reason after a while always starts having very slow "sudo" authentication (or an authentication in general, like GUI apps asking for credentials). It's will work ...
1
vote
1answer
91 views

Why does printf work differently with sudo?

I have a simple script to convert a text file with colour escape sequences to the actual characters. It works if I run it directly, but not with sudo. To set up the scripts: test.txt ...
-1
votes
1answer
379 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
2k 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
0answers
108 views

sudo and ulimit - behaviour change?

I've noticed a behaviour change between sudo in Ubuntu Saucy 13.10, which has sudo 1.8.6p3, and Ubuntu Trusty 14.04.1 LTS, which has sudo 1.8.9p5, but I don't understand precisely what it is, or what ...
5
votes
1answer
563 views

Lost passwordless sudo and no root access

I have a running AWS vm. The only access I have is using the ssh key (.pem file) to log in as ec2-user which is an unprivileged user. From there, I could user the sudo command without a password. ...
1
vote
2answers
107 views

Recover sudo password of server over ssh

I am working on an ubuntu 12.04 server and i was not provided a sudo password. Now i need to recover it. I found out that we need to reboot into recovery mode to do so but we don't know how to get ...
0
votes
1answer
429 views

Centos : su: incorrect password after bash update

A few days ago I've updated the bash to patch it agains Shellshock and since then I cannot su - root from my regular 'wheelgroupuser' account on Centos 6.5 with WHM. I'm constantly getting su: ...
0
votes
1answer
356 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 ...