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

learn more… | top users | synonyms

0
votes
1answer
30 views

yum search fails when run as non-root user

My yum has started failing to do search as a non-root user. This was working previously, and then something has been gummed up: sudo yum update works fine, as does sudo yum search blah. yum search ...
1
vote
1answer
24 views

Issues when monitoring a gluster FS mount with Nagios via sudo

I have been monitoring a gluster FS mount with the following script, but have issues executing the script via NRPE. Here's my script on the remote box. /usr/lib64/nagios/plugins/check_gluster.pl ...
-2
votes
1answer
33 views

sudo permissions without root access

I want to give certain users on my server access to run commands as apache, but I don't want to give them full root access. Is there a way to allow a user to run a command similar to sudo -u apache ...
2
votes
4answers
143 views

Starting a script as another user

I've created a script in /etc/init.d/ which has to run several other scripts from other (non-root privileged) users from their home directories, as if they started them. I launch these scripts ...
0
votes
2answers
29 views

permission denied using sudo

I have an alias in my .bashrc file that runs an executable python file like so: alias my-command="sudo -u apache /path/to/file.py" When I run my-command It prompts for my sudo password and then it ...
0
votes
1answer
41 views

Upgrading sudo rights

One my server, I've given the main user for the web server, access to /usr/bin and /tmp. I did this so that ceartain scripts could could call exim without this user needing to have full sudo rights. ...
39
votes
6answers
3k 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
46 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 ...
0
votes
1answer
17 views

Allocate pseudo TTY in Upstart configuration file

We would like to use Upstart to manage a Java process and run it as non-root using sudo. We are on RHEL 6 which means that Upstart is too old to allow us to explicitly specify a user hence the use of ...
2
votes
4answers
63 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 ...
0
votes
3answers
119 views

How do I disable the sudo password prompt?

I've managed to disable PermitRootLogin in my sshd_config file for security reasons. My new user is in the sudoers file, but every time I have to use the sudo bash command I must enter my password if ...
4
votes
1answer
69 views

How can I force sudo to accept a user's AD password on RHEL6

In our environment we do not join Linux boxes to the Microsoft Domain. We do however setup Kerberos. This allows us to log into the boxes using our AD credentials as long as there is a local account ...
0
votes
1answer
50 views

execute sudo script on linux from windows

I need to connect to linux,run script which requires sudo. now i am trying this way: plink.exe -ssh -pw mypassword -noagent myname@10.111.11.123 "sudo /var/squid/myscript.sh in linux i added in ...
0
votes
1answer
37 views

sudo su in screen — security issue?

Just logged back into a server and reconnected to an existing screen using screen -R. I had completely forgotten that I'd used sudo su - earlier and had not exited afterwards, so when I reconnected ...
2
votes
1answer
224 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 ...
-1
votes
2answers
52 views

Sudo access on Ubuntu

I'm new to linux and the sysadmin world all together, so I'm looking for some advice and a couple of answers. I set up an EC2 instance running Ubuntu 12.04 and I SSH in via key pair. First of all, I ...
2
votes
2answers
67 views

Root user is not able to access

I had a ubuntu user which has root level privileges but I haven't created password for it, there are other user also on the machine but none of them have sudo permissions, unfortunately permissions on ...
0
votes
1answer
35 views

Changing the user after sudo - command over ssh

Im accessing my sever over SSH, with a normal user account. At some point i need to log as root, i have the root and password credentials, but when I invoke the sudo - command the prompt ask me for a ...
1
vote
1answer
79 views

Include AD domain admins group in Linux sudoers?

I'm working in a company whose network is configured through a Win Server Active Directory, with hundreds Windows of computers connected to the local domain. We are doing some tests to start ...
0
votes
2answers
125 views

running a remote shell script that switches to a user does not return to the issuing local server shell

When I run a script such as this: ssh -t root@10.10.10.10 '/tmp/somescript.sh' where the script is defined as: #!/bin/sh mkdir -p /data/workday/cred chown -R myuser:myuser /data su myuser - # ...
21
votes
5answers
2k views

Can a program tell it is being run under sudo?

I have a program that should behave differently if it is being run under "sudo". Is there a way it can find out if it was run under sudo? Update: Someone asked why would I want to do this. In this ...
0
votes
3answers
71 views

EC2 Automatic Instance Sudo Not Working

I'm using Atlassian Bamboo to setup a build server. It allows the use of "elastic images" which I can specify which of their AMI's to use (I'm using the Amazon Linux/CentOS image). It also allows you ...
1
vote
1answer
50 views

What are the most optimal permissions for /bin/su?

I want users to be able to use "sudo su -", but not to switch user by password. What are the most optimal permissions for /bin/su? Right now it's: -rwsr-xr-x. 1 root root 42436 Jul 26 18:19 /bin/su ...
4
votes
1answer
462 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
94 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 ...
10
votes
1answer
495 views

How can I implement ansible with per-host passwords, securely?

I would like to use ansible to manage a group of existing servers. I have created an ansible_hosts file, and tested successfully (with the -K option) with commands that only target a single host ...
3
votes
2answers
79 views

Use database for sudo

I asked a similar question today, about how to authenticate my server users to a postgres database instead of the /etc/passwd file or LDAP, and I got some useful answers there. I figured out that I ...
-3
votes
2answers
160 views

Allow any arguments for a given command with sudo [closed]

I have the following sudo config entry which I added via sudo visudo: mark ALL = NOPASSWD: /usr/bin/lxc-ls* I can run lxc-ls with my user fine but I can't append any parameters without it demanding ...
-1
votes
1answer
61 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
54 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
150 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, ...
-1
votes
1answer
72 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
29 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
439 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 ...
2
votes
1answer
54 views

sudo use on a user in multiple groups asking for password when one group has no password

so I have a user running sudo and they are in both wheel and other_group. other_group shouldn't need a password but wheel does. My question is : does wheel requiring a password for sudo negate the ...
1
vote
4answers
197 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
138 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 ...
4
votes
1answer
120 views

sudo fine, sudo ls not working (command not found)

On Ubuntu 13.04 running in EC2, all commands through sudo work fine except ls. Here are some example commands to illustrate the issue: ubuntu at host in ~ $ sudo ls sudo: command: command not found ...
4
votes
1answer
345 views

su gives permission denied

I have installed su to allow a security analyst to login to a VPS to make some changes who needs root permissions - I have created a user and they can login fine under their acount but as soon as I ...
0
votes
1answer
264 views

sudo does not prompt for password and reports 3 incorrect password attempts

User smithj is listed in the /etc/sudoers file: root ALL=(ALL) ALL smithj ALL=(ALL) ALL smithj logs into the system via putty. He attempts to sudo but gets this: sudo adduser jonesjp Sorry, try ...
0
votes
4answers
418 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 ...
0
votes
1answer
45 views

Proper way to switch users in sudoers

What is the difference between these 2 options in /etc/sudoers: user1 mymachine = (user2) ALL user1 mymachine = /bin/su - user2 For option 1, I would do the following as user1: sudo -u user2 -i ...
3
votes
1answer
120 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 ...
1
vote
2answers
210 views

Why doesn't sudo know where psql is?

The problem The CKAN installation documentation shows you how to list the installed PostgreSQL databases. The command looks like this: sudo -u postgres psql -l When I try that in my shell, I get ...
8
votes
4answers
682 views

`sudo echo “bla” >> /etc/sysctl.conf` permission denied

Disclaimer: I'm pretty novice at sysadmin stuff. I'm trying to set up port forwarding in an AWS EC2 instance, this has to be done in the command-line because I don't want to go in and edit anything, ...
-2
votes
1answer
49 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 # ...
0
votes
2answers
62 views

Multiple sudo types for one user

I have a situation where I want the main admin user (with sudo for all) to have passwordless sudo as another user for one command. To my knowledge, that should give the following in /etc/sudoers: ...
4
votes
1answer
376 views

Granting sudo access to a SELinux confined user in freeIPA

I'm using freeIPA to define RBAC, HBAC and sudo rules, as well as SELinux user mappings for a domain of a couple hundred virtual machines, where I need to grant different levels of access to several ...
1
vote
1answer
66 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 ...
2
votes
1answer
341 views

Change “Not in sudoers file, this incident will be reported” message?

Is it possible to edit this message that someone sees when a sudo command fails due to permissions problems?