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
25 views

Error mounting ebs in amazon ec2

I have accidently changed permissions for my /etc/sudoers and /etc folders and thereby I am unable to access anything through sudo. After that I detached my ebs volume from the instance and attached ...
1
vote
1answer
33 views

Confusing e-mail related to sudo

My system occasionally sends me this email. (My domain has been replaced with [DOMAIN] and my username has been replaced with [USERNAME].) Subject: *** SECURITY information for [DOMAIN] *** [DOMAIN]...
2
votes
0answers
31 views

ssh -t -t sudo displays back my password

My problem is about executing sudo over SSH. I have tried various things, but non works. Here is my script: ssh my-host /bin/bash << EOF # some commands... sudo -u my-user -s -- << EOFF ...
1
vote
2answers
54 views

/dev/sdc1: unable to read superblock

Linux Ubuntu 14.04 (azure server) I was trying to backup /dev/sda1 drive so I executed the sudo dd if=/dev/sda1 of=/dev/sdc1 command. While executing the command is available, the space was ...
1
vote
1answer
25 views

Is there a way to configure sudo to not need to lookup group names / or speed up sssd group name resolution?

I've got a large number of Linux hosts that are connected using sssd to a windows active directory domain for user/group lookup. That mostly works fine except for one problem; sudo From what I'...
0
votes
2answers
50 views

Is there a way in Linux where one non root user can check if another non root user is using OpenSSL or not without sudo permission?

Consider this scenario where User-A and User-B are both non-root user are running inside a server. User-A is running different Program P1 (pid-2814),P2(pid-2815) whereas User-B is running different ...
0
votes
1answer
41 views

CentOS 7 Virsh - Allow Non Sudo Users to Interface with QEMU / KVM / Virtual Machines

Is there a way to allow non sudo users access to KVM QEMU virtual machines in CentOS 7? I want to allow a non-root user to manage KVM guest virtual machines without having sudo access. Mainly, I'd ...
0
votes
0answers
53 views

Ansible-galaxy not working with sudo

I'm having problems instaling plugins with ansible-galaxy. I've tried 3 things: Instaling without sudo: ansible-galaxy install sfromm.epel [WARNING]: - sfromm.epel was NOT installed successfully: ...
0
votes
1answer
23 views

How can I ensure auditability and least privilege based on AWS users inside an EC2 image?

I'm interning at a company which runs in an AWS environment and is starting to look into locking down user privileges, so I'm looking into ways to secure EC2 instances. Specifically, I want to find a ...
0
votes
0answers
16 views

Composer works as Common User but not root

When I run 'composer' as a common user, composer runs just fine. However if I run 'sudo composer' I receive a command not found message. When I enter 'sudo /usr/local/bin/composer' it works just fine. ...
3
votes
2answers
100 views

Allowing PHP to run specific bash script with root permissions

I have a php script calling a bash script like this: <?php $result = exec('sudo /bin/bash /var/www/my_bash_script.sh /var/www/vhosts/testsite/htdocs/'); var_dump($result); ?> This is ...
0
votes
1answer
38 views

How to register user on ejabberd using php code?

I am trying to register user on ejabberd linux server. I am using below php code <?php $username = 'hello'; $password = 'hello'; $node = 'my ip'; exec('sudo -S ejabberd /usr/sbin/...
1
vote
1answer
116 views

Sensu executing script sudo a password is required

I have a sensu handler that gets triggered on an endpoint Linux box (Centos 6.6. Here is the script I'm using: #!/bin/bash --login sudo -n -u deploy bash --login -c "cd /var/www/vhosts/sc/current; ...
1
vote
1answer
21 views

Centos 6 - Allow sudo composer self-update for user without password

I'm trying to allow my wheel group user to run sudo composer self-update without a prompt for a password for my deploy script. I have added the bottom line below to my /etc/sudoers file: ## Allows ...
2
votes
1answer
36 views

bash: /etc/hosts: Permission denied [duplicate]

Why when I run I get the error: $ sudo echo "127.0.0.1 db-local.internal" >> /etc/hosts bash: /etc/hosts: Permission denied But when I do sudo su I can edit this file without any problem.
-1
votes
1answer
68 views

Setting up SSH with the correct user rights [closed]

I want to setup my SSH connection correctly. As many tutorials told me, it is not recommended to use the root account of Ubuntu server. So I would rather use my standard account "Simon" to upload ...
0
votes
2answers
36 views

Sudo command refused (htpasswd) - CentOS / Apache (htaccess)

I want to give one of the web developers testuser permission to set his own .htpasswd password using the /usr/bin/htpasswd command on the web server 'mywebserver'. The web server tree belongs to the ...
1
vote
1answer
30 views

Running npm via sudo (not as root, not as self-user) can't find npm where root or self-user can

I have a makefile, which I use to sudo make install for the parts of my app that generally require root installation. Unfortunately, this results in a strange situation where sudo doesn't have access ...
0
votes
0answers
63 views

remote execution of commands using sudo /usr/bin/ssh

I have the following sudoers file in /etc/sudoers.d: Cmnd_Alias GETCONFIGFILES = /usr/bin/ssh servername.mydomain.com -p 1022 'cat /path/textfile.txt' User_Alias TOMCATUSER1 = localuser TOMCATUSER1 ...
0
votes
1answer
41 views

Restricting su command in a specific manner

I have a list of system users who have access to almost everything via sudo. Now I would like to restrict their sudo access for command su. I would like to restrict su command for every user on ...
0
votes
2answers
62 views

Access /proc/$pid/exe as regular user

I am in the process of developing a custom Nagios plugin to monitor the absolute path of a few running processes. As a root user I have always used the command 'ls -l /proc/$pid/exe to find the path ...
1
vote
0answers
12 views

sudo as another user that contains current user string in username

Let's say there are 100 users in the system: msmith bdole agrant . . . Is there a way to write a generic sudoers rule to allow each of these users to execute commands as another user, where the ...
0
votes
0answers
20 views

Run a script if another process was spotted

I have CentOS 7 and looking for a sollution about a small issue. I want to have a sudo script to be run but only if the system executed a specific command remotely. For example: I've put my command ...
2
votes
1answer
80 views

use Sudo in apache

I am using CentOS 6 and trying to call sudo in Apache using this command: exec("sudo -u kouser whoami 2>&1",$output,$code); However SElinux add a line to output array(2) { [0]=> ...
0
votes
2answers
72 views

Using GREP to Find Text in Files

I'm trying to use grep to find a specific line of PHP code I know for certain is present in several files, but all I get back is an empty result. Please advise on how I need to modify my grep query: ...
1
vote
2answers
51 views

Recursive Sudo Privileges

I am in the process of setting up specialized sudo for our first line support team. I would like to authorized them to delete anything within /var/log/. The command below however only applies to files ...
0
votes
1answer
42 views

SUDO command only works as root (Solaris 10)

After installing sudo in the system i am unable tu run sudo as a non-root user, when i try to execute any command i get: /usr/local/bin/sudo: cannot execute if i edit /etc/passwd to use a different ...
1
vote
1answer
143 views

Difference between sudo /bin/bash and sudo su to access root

I am aware that there are at least 2 ways to escalate to root privileges when in the terminal, and am genuinely curious as to whether there is a differences / are differences as to what can be ...
2
votes
2answers
85 views

Linux: Allow user to execute specific command on behalf of any other user

I am trying to find a way to allow user john to execute a command (say echo) on behalf of another user peter without being prompted for password. I found a thread that I thought would be the answer ...
1
vote
2answers
29 views

Prevent root in linux from changing folder permissions in GPFS filessystem

I have created a NFS export in a GPFS/SpectrumScale filesystem I created. I have enabled AD based authentication with our domain. Everything works. The NFS export was created with NFS4. The NFS ...
1
vote
1answer
25 views

Unable to mount NFS export unless I sudo to root

I created an NFS export on a GPFS/SpectrumScale filesystem I set up. I tested the NFS export on a xLinux, pLinux, z/OS and AIX succesfully. I then enabled AD based authentication on the NFS export ...
0
votes
0answers
62 views

How to autostart node forever and spawn() as sudo?

My app periodically spawns a CasperJS scraper: spawn(CASPER_PATH, [SCRIPTS_PATH + fileName, '--ssl-protocol=any', '--user='+user, '--scrapeId='+scrapeId, '--pass='+pass], { detached:...
1
vote
0answers
22 views

How to run root commands form a website? [closed]

Im working on a project, in it I intend to make a website with server administartion functionalities. So far, I'm able to run all guest commands like ping,nmap,etc. But, I want to run root commands as ...
2
votes
1answer
37 views

Create a Web User

I am running Apache 2.4.8 on Arch Linux, but that doesn't matter really. I would like to create a user who is devoted to web management. I have created a user, a group, and added the user to the ...
-2
votes
1answer
45 views

Is it possible to “sudo su” using ssh in bash? [duplicate]

#!/bin/bash USERNAME=ksmith HOSTS="linux1" YUPDATE="sudo yum -y update" FIXDATE="sudo -u echo -e 'ZONE="America/New_York"\nUTC=true' > /etc/sysconfig/clock" for HOSTNAME in ${HOSTS} ; do ssh -tt -...
0
votes
0answers
130 views

sudo NFS SUID not working

Today I decided to move my NFS files from an ext4 HDD to an ext2 HDD using mc. Since then I am having trouble running the sudo command on all clients. When I try to run it I get an error saying "...
0
votes
1answer
231 views

sudo and Kerberos on AWS Linux issues

We have an issue on some of our AWS machines, running Amazon's hacked Fedora/RHEL linux where newer-in-AD users can login with password but cannot autheticate for sudo. Users that were created in AD ...
0
votes
1answer
2k views

sudo mv fails with “Operation not permitted”

When I command on my MacOS: > sudo mv /usr/bin/php /usr/bin/php-52 I get the result: mv: rename /usr/bin/php to /usr/bin/php-52: Operation not permitted What can I do? Thanks!
5
votes
1answer
113 views

Limit number of concurrent users switching to root account?

This is for Ubuntu 14.04 and Centos 7. I need to limit the number of users actively running as root. i.e. Logged in as root on the CLI. Basically, I want only one user at a time to be able to run ...
0
votes
0answers
58 views

cann't we have 32 bit uuid package installed along with 64 bit uuid package in ubuntu 12.04 64 bit

i am using 64 bit Ubuntu 12.04. i am trying to build 32 bit project in 64 bit Ubuntu OS. UUID generator related functions in a library. it is giving below linker error related to luuid: /usr/bin/...
-3
votes
3answers
77 views

I want a user to run bash scripts with sudo [closed]

So this is for a school assignment. I have a working Bind9 and Apache2 server. I've written 3 scripts that make appropriate changes to the configuration files DNS add zone DNS add record HTTP add ...
1
vote
0answers
37 views

Using Ubuntu Server 14.04 as a webdeveloper [closed]

I have a Ubuntu Server 14.04 installed in my network used solely for development of websites (PHP, Laravel). Websites are located in their own directories under /var/www/domain.ext and can be accessed ...
0
votes
1answer
453 views

Ansible become_user not picking up path correctly

Here's the code showing what I believe is a problem: # Debugging path problems with sudo --- - hosts: webservers remote_user: root tasks: - name: echo path command: echo $PATH register: ...
1
vote
3answers
125 views

Run bash script as sudo from windows without interaction

I need to execute a bash script as sudo on a remote linux machine from TeamCity running on a windows box. I can execute the script fine from the cmd line using plink, but I am prompted for a password....
3
votes
0answers
783 views

Running service with systemd as default user via ansible in ec2 (requests password)

I'm trying to employ the following Ansible script (part of a playbook) to run unicorn via systemd for a rails app on EC2 (micro) instance: --- - name: restart unicorn command: psql -h {{ db_host }}...
0
votes
0answers
14 views

Appropriate user permissions for reading private dkim file contents from web app

As it stands, when sending email using clients like Thunderbird, my messages get signed with DKIM. However when generating emails from a web application, they do not get signed. As it stands I've ...
23
votes
2answers
2k views

Why does password entering work in a piped sudo command?

If I do: sudo cat /etc/resolv.conf | less It will prompt me for the password, even though less (presumably) takes stdin. Over what fd's is the password prompt shown and how does it get the input ...
-1
votes
2answers
43 views

debugging sudo -i -u www-data -g www-data env

When I run sudo -i -u www-data -g www-data env I get sudo: unable to change directory to /var/www: No such file or directory This must be coming from script somewhere, but I don't know where. How ...
1
vote
1answer
71 views

Executing php as sudo inside crontab [duplicate]

I've wrote a PHP-Script, and the execution requires sudo permission, because it executes some other system related stuff. So i've added this into the crontab -e but i can't see, that my script is ...
1
vote
0answers
18 views

restoring debian user access

I have accidentally set the owner for all files and folders in the /home folder to 'root' (and a lot of other folders also) and now when I ssh into the server as myusername, I get the following error: ...