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

learn more… | top users | synonyms

-1
votes
1answer
47 views

How to make sudo -u not require password

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 ...
0
votes
0answers
3 views

Why does “$ sudo echo 'yo' ” works? [migrated]

I understand that sudo cd /directory will return: sudo: cd: command not found because cd is a shell builtin and not a binary. But then, why does sudo echo 'this is a test' works fine? What ...
1
vote
0answers
18 views

OpenWrt: Cannot install package sudo [migrated]

I have installed the latest OpenWrt Chaos Calmer r42871 on my TP-LINK WR-842ND router. And everything's good except the problem: root@router:~# opkg install sudo Unknown package 'sudo'. ...
1
vote
0answers
8 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
34 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
31 views

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

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
53 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
25 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
465 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
61 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
74 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
0answers
35 views

How can I sudo su and change directory just after? [migrated]

I would like to create an alias that does something like this: alias userYYY='sudo su userYYY; cd /a/path/that/only/userYYY/has/access' So then from my command line, I am logged in with a sudoer ...
0
votes
1answer
28 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
94 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: ...
33
votes
8answers
3k views

How can I run arbitrarily complex command using sudo over ssh?

I have a system that I can only log in to under my username (myuser), but I need to run commands as other user (scriptuser). So far, I have come up with the following to run the commands I need: ssh ...
0
votes
1answer
116 views

Capistrano 2 update_code task not using sudo

I'm using Capistrano 2(.15.4) to deploy rails applications (i know, trying to get to 3 but not quite there yet). We have a new server environment being set up, with IT preferring access through our ...
-2
votes
1answer
43 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 ...
0
votes
3answers
72 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
61 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 ...
4
votes
2answers
176 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 ...
2
votes
2answers
357 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
387 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
100 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
205 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
61 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
59 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
233 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
796 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
79 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
233 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 ...
0
votes
0answers
58 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
46 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 ...
3
votes
0answers
127 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
63 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
66 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
84 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
499 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
386 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 ...
1
vote
1answer
2k 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
95 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
411 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
122 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
2k 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
285 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
553 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
70 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
61 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
163 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
116 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 ...