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

learn more… | top users | synonyms

0
votes
3answers
49 views

Securely executing system commands as sudo from PHP

Is it possible? I have written a command line tool in PHP for creating new environments for our company. It creates system users, directories, databases, VHosts and restarts apache, amongst other ...
0
votes
1answer
38 views

Sudo keeps asking for password on / mounted over NFS

I have a diskless server booting Ubuntu 14.04 with / taken from NFS. I use nfs-kernel-server. I have some strange behaviour of sudo and locate. sudo keeps asking for passwords despite the Defaults ...
3
votes
2answers
114 views

Is “sudo su -” considered a bad practice?

Background I know the difference between su -, sudo su -, and sudo <command>: su - - switches user to root, requires the root password sudo su - - switches user to root, requires only the ...
1
vote
2answers
298 views

How to bypass sudo

I am trying to script a non-interactive install of Meteor (JS Framework) and part of the script prompts for sudo . I cant seem to get past it w/ my scripting skills. The install is : curl ...
-2
votes
1answer
106 views

sudo yum install httpd is throwing errors

Hello this is the command im typing and its returning the error you see, any suggestions please [ec2-user@ip-172-31-41-46 ~]$ sudo yum install httpd Loaded plugins: priorities, update-motd, ...
-2
votes
3answers
80 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 ...
0
votes
1answer
68 views

SELinux blocking sudo from zabbix_agentd

I have a custom user parameter for Zabbix that calls a hardware RAID CLI tool (arcconf / megacli) and checks if any arrays are degraded. Since these tools are root-only, I have configured sudoers to ...
1
vote
0answers
32 views

RHEL Equivalent of AIX's chuser login=false rlogin=false

On AIX, I can disable login/remote login by setting the attributes listed to false, but I will still be able to su from other users, and sudo as the user. Is there an equivilant in RHEL to the ...
0
votes
2answers
42 views

Disable NOPASSWD sudo access for ubuntu user on an EC2 instance

How can I disable the passwordless sudo access for the default ubuntu user on an EC2 instance? Is it safe to do it?
2
votes
1answer
153 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 ...
2
votes
1answer
128 views

Ansible ssh as user and execute has root (expect like)

I have to administer an important number of hosts where there is only one user able to access from SSH (let's call him foo) and then have to login as root to execute privilegied commands. Foo user ...
0
votes
0answers
45 views

Edit a remote file in Vim with sudo when ssh root login is disabled

I am trying to determine a way to edit remote files in Vim that require sudo, but still use my local vim config and plugins. Currently I can open vim and :e scp://me@server//some/root/file and make ...
7
votes
1answer
213 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 ...
1
vote
0answers
55 views

Allow sudo without su [duplicate]

1) Yes, I know this is not air-tight security 2) I trust my admins, I'm just looking for a little more accountability on some key systems 3) Yes, I know they can bypass this if they try. That's ok. ...
0
votes
1answer
37 views

Management of system directory in linux using git

I'm using puppet to manage my linux systems. I have to use /etc/puppet directory to keep manifest files instead of user home directory, and I want to manage them by git. But because /etc/puppet's ...
2
votes
0answers
44 views

Kerberos, .k5login and sudo

Background: I am using a Debian 7 system which I have integrated with an LDAP+Kerberos system using libnss-ldap, libpam-krb5 and nscd. I have modified sudoers to permit an LDAP group the right to sudo ...
1
vote
1answer
39 views

mkdir is not working with sudo and shell option

One of the application trying to create directory failing with the below error on Linux machine: $ /usr/bin/sudo -su oracle /bin/sh -c '/bin/mkdir -p /u01/app/oracle/test12' /bin/mkdir: missing ...
2
votes
2answers
55 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 ...
1
vote
3answers
71 views

What's the best way to mitigate NFS and sudo?

Quick background: We have 40 workstations running Linux. NFS is used extensively for bulk data storage and home directories. This allows users to roam freely will relatively transparent file ...
13
votes
3answers
487 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?
2
votes
1answer
214 views

How do I “sudo -i” specific command

I need to run important_script.sh as with sudo -i without password. If I have in sudoers: apache ALL = (root) NOPASSWD: /blah/important_script.sh and run "sudo /blah/important_script.sh" I can ...
0
votes
1answer
675 views

What's the difference between sudo su - postgres and sudo -u postgres?

PostgreSQL users peer authentication on unix sockets by default, where the unix user must be the same as the PostgreSQL user. So people frequently use su or sudo to become the postgres superuser. I ...
1
vote
2answers
62 views

How does Amazon ec2-user get its sudo rights

I am looking for where the default Amazon AMI linux image sets up the privileges for the default ec2-user account. After logging in with this account I can use sudo successfully. Checking via the ...
1
vote
4answers
266 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
80 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 ...
1
vote
3answers
254 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 ...
0
votes
2answers
109 views

why does sudo su; su tomcat doesn't switch to tomcat user?

In Redhat linux. from my user if I issue command sudo su -> changes to root su tomcat --> changes to tomcat user Why does tailing the commands in single line doesn't work? sudo su; su tomcat --> stil ...
8
votes
2answers
465 views

Symbolic link and sudo

I create a symbolic link: ln -s /tmp/folder1 /tmp/folder2 Then I go to /tmp/folder2 and run pwd: $ cd /tmp/folder2/ $ pwd /tmp/folder2 $ sudo pwd /tmp/folder1 # <-- This is the odd part Why ...
1
vote
1answer
51 views

Allow apache to run a sphinx command

I need apache to be able to run sphinx index tool as I am building a web based interface to reindex and check various sphinx configs. Currently I have added the following to visudo Defaults:%apache ...
-1
votes
2answers
56 views

Security in users having sudo access

How to protect my passwords list (in different databases for example) in a UNIX environment where most of the users have sudo access to other user IDs? I have a script (main.sh) with the following ...
0
votes
1answer
101 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
86 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
40 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
237 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
55 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. ...
40
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
95 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
85 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
108 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
160 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
243 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
228 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
56 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
255 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
53 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
76 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
94 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
481 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
246 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 - # ...