Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [sudo]

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

-1
votes
1answer
46 views

sudo user is not allowed to execute systemctl

I'm trying to allow a user to use sudo to manage a custom systemctl service, this however seems to fail and I can't figure out why. [root@testvm sudoers.d]# ll total 16 -r--r-----. 1 root root 334 ...
0
votes
2answers
41 views

How to make sudo commands work over ssh without asking for a password?

I set up a server to accept ssh without passwords, and it works fine for nonprivileged commands. However, when I try to run sudo commands, I'm still asked for a password: $ ssh -t test@192.168.1.52 "...
0
votes
0answers
9 views

Minimum permissions for user vagrant to manage box

I'm using vagrant with an ubuntu 14.04 image for my project and I aim for least privilege for the user vagrant. I will not get into details of the motivation for simplicity sake, but let's say it's ...
-3
votes
1answer
74 views

Google Cloud Compute Engine CentOS 7 Sudo command

Till Friday 12/10/2018 I was able to run sudo commands (Ex:sudo mongodump --db iot_ac). Today When I tried to run any command as root(sudo),i get the below message(Connected through SSH): We trust ...
1
vote
1answer
34 views

Sudo: cannot setup user to avoid being asked for password

I run: sudo visudo and set this line for my user myuser ALL=(ALL) NOPASSWD: ALL however, I am still asked a password when I run a sudo command how can I setup the user so that the password ...
0
votes
1answer
49 views

How to create sudo rules to access non-root local accounts that prevent any action being taken on a specific file?

I have the following rule set that allows a group to run any command as user "apache": %Test_team ALL=(apache) NOPASSWD:ALL I want to limit the ability to run any command (cat/cp/rm/vi, etc) on ...
0
votes
0answers
38 views

How to use “sudo” for installing an app on gitlab.com for CI?

I have a project at gitlab. I'm setting up Continious Integration for it. I need to install sphinx search engine and it requires sudo. - http://sphinxsearch.com/files/sphinx-3.0.3-facc3fb-linux-amd64....
0
votes
0answers
85 views

CentOS sudo fail when using pam_faillock.so

This refers to another question at sudo does not prompt for password and reports 3 incorrect password attempts The problem is, when the following line was added to /etc/pam.d/system-auth-ac to fix ...
1
vote
3answers
51 views

Why /etc/sudoers failed when doesn`t use absolute path?

I want to give my account nova sudo priviledge so I add this configure to /etc/sudoers Defaults:nova !requiretty nova ALL = (root) NOPASSWD: /openstack/bin/nova-rootwrap /etc/nova/rootwrap.conf * ...
0
votes
2answers
57 views

Use non default route as non privileged user

On Ubuntu 16.04, the default route for IPv4 is an interface other than eth0. If I try to curl -vvv --interface eth0 v4.ifconfig.co I get * SO_BINDTODEVICE eth0 failed with errno 1: Operation not ...
0
votes
1answer
203 views

Restart or reload Apache as “www-data” user

I have a webhook script written in Python on my Debian/Apache2.4 server, so that it runs a deploy .sh script when pushing on GitHub. So, the script is executed by standard Apache user "www-data". My ...
1
vote
0answers
30 views

sudo no more working after change to /etc/hosts

I had to add a DNS alias into /etc/hosts, and I've added it in first position instead of last, replacing the FQDN. After this (not right after, but at least the next day), sudo was no more usable, ...
2
votes
1answer
55 views

docker-machine with “generic” driver: security concerns

I want to use docker-machine to deploy containers on a Debian 9 server from my local computer. I followed instructions from this page, which clearly indicates: If you are using « sudo » on the ...
1
vote
1answer
189 views

sudo followed by another command in ssh heredoc not working

This is my script: #!/bin/sh echo "I'm local" ssh -t -t remote.server << 'EOF' sudo echo "I'm remote and sudo" echo "I'm remote but not sudo" exit EOF This simply doesn't work, ...
0
votes
1answer
176 views

Sudo not working. How to reset root password Ec2 (AWS)

I installed a SSL certificated the day before. Today I wanted to log in to the server. When I try to "sudo" it gives me the following error message: sudo: unable to stat /etc/sudoers: No such file or ...
0
votes
1answer
22 views

Moved libnspr4.so, now cannot sudo

When trying to solve another problem. I ended up moving libnspr4.so to my home folder. Now when I try to copy it back to /usr/lib64 folder it says sudo: unable to dlopen /usr/libexec/sudoers.so: (...
0
votes
2answers
57 views

Is it safe to allow any user to see the status of all services?

I would like to allow every linux user to see the status of all systemd services. I created these lines for the /etc/sudoers file: ALL ALL = NOPASSWD: /usr/bin/systemctl is-active * ALL ALL ...
0
votes
0answers
12 views

Keep local environment variables with policy kit?

Both sudo and policykit (pkexec) restrict the amount of environment variables one could use when executing a program via them. I have recently learned that sudo allows program builders a way for ...
0
votes
1answer
32 views

Is it fine if an external program edit the sudoers file?

My program needs some local environment variables while running as root to perform certain tasks. Would it be fine to write a subroutine that can change users sudoers to keep these variables? It's not ...
1
vote
3answers
151 views

Access a linux server without being on the sudoers file

I have my Jenkins installed on a windows server and I have created a Jenkins user on the server now I need to push the WAR files to my Linux server to a particular user root (myrootuser) who is there ...
0
votes
0answers
56 views

Need to give a non-privileged user permission to execute apachectl script

I want that a regular user to be able to execute apachectl in the system. And that would be the only thing that they can do outside of it normal permissions. What I did is to add this line at the ...
-1
votes
1answer
104 views

`sudo apt-get -f install` fails everytime [closed]

This command sudo apt-get -f install fails every time I try to run it.
3
votes
2answers
842 views

Checking sudoers.d files with Ansible

I have an Ansible playbook I use to manage our sudoers files across our environment. We like to keep a minimal sudoers file at /etc/sudoers, then anything we want to add gets put into separate files ...
0
votes
2answers
53 views

Call app with sudo and custom environment variable

I need to call sqlplus with oracle user sudo to clearly specified DB (env var ORACLE_SID) by one line command. The usual way to do it consists of 2 steps: $ sudo -u oracle -i $ ORACLE_SID=DBNAME ...
1
vote
0answers
34 views

Aliases defined at login don't seem to work with sudo

I'd like to define some global aliases which would be available for everyone on a mult-user linux system (git shortcuts, etc). It seems I have two options avaialable; either place these aliases in (...
0
votes
1answer
225 views

Allow user to sudo as any user in group

I'm running a service where I have users that are running services from their home directories. They are all in the group serviceusers, and I have a user that will perform automated tasks initiated ...
9
votes
4answers
939 views

linux command found but not found when using sudo

I am trying to run a python3 install like this: pip3 install django I get the error: PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.6/site-packages/pytz' I then try: ...
0
votes
0answers
130 views

Defining Linux User Groups using Radius & MySQL

I have successfully setup Freeradius to authenticate users in MySQL under the radius.radcheck. I've also been about to restrict users to specific servers based on groupnames under radius.radusergroup ...
3
votes
1answer
215 views

Why can't I use pam_echo.so in the sudo pam stack?

I have a CentOS 7 machine where I'd like to display a message when authentication fails during sudo. I tried to do this by adding a pam_echo line in /etc/pam.d/sudo. For testing, I created a file, /...
0
votes
1answer
114 views

doas on FreeBSD does not respect 5 minute timeout

I've setup doas to run on FreeBSD 11.1 as per these instructions and added the following line to my doas.conf: permit persist :wheel I've noticed that I need to insert my password every time I run ...
0
votes
1answer
21 views

Does 'sudo' extend its timeout every time you use it?

If I use sudo, and type my password in, I can continue to use sudo without my password for 15 minutes. I know (per man sudoers) that I can edit the timeout by setting the timestamp_timeout value in /...
0
votes
1answer
781 views

SUDO NOPASSWD not working on a specific command

I have a tricky situation. I need a user nagios to execute a specific command as another user jenkins -- However this command only works if the jenkins environment is fully loaded. Otherwise the ...
0
votes
2answers
63 views

File specific visudo permissions

I'm trying to integrate some bash scripts into a website admin area. Background I'm running apache on Ubuntu server. Giving apache (www-data) sudo rights is far from ideal, so I'm not going to. ...
0
votes
1answer
104 views

Linux ksu (kerberized super user) command fails to use cached service (host) tickets

Questions at the end About my environment I have tried in two different environments: (i) Linux Ubuntu 16.04LTS server enrolled in Active Directory (Microsoft) Domain and (ii) Linux Ubuntu 16.04LTS ...
0
votes
2answers
575 views

Can a line in a file in the /etc/sudoers.d directory have multiple users?

I've got the following file setting permissions on my machine: /etc/sudoers.d/myuser This has the following contents: myuser ALL=(myuser) NOPASSWD: ALL I'd like to add a second user to this list, ...
1
vote
1answer
65 views

Specific sudo-shell command takes up to 20 minutes

I'm running multiple LEMP stacks on Google Compute Cloud infrastructure. All VM's are identical to eachother when initiated and I've got this weird issue with one of them. Whenever I run this command, ...
-1
votes
1answer
43 views

visudo + read access to file from non root user

how to access file by visudo from non root user , or other option for example when we change user to hdfs and from user hdfs we want to print the file - file.cfg we get Permission denied how to ...
0
votes
0answers
76 views

Sudo is taking forever to run the first time

I am running into this issue where the first time I run sudo the command takes about 30 seconds before it will prompt me for my password. (NOTE: after I have entered my password, all the following ...
0
votes
1answer
78 views

Running a command from apache user as ec2-user

I'm trying to run the following command /usr/bin/ocr 1.pdf 1.xml from Apache, but unfortunately this command only works with ec2-user. So I've tried to edit my PHP file to make it run like that: /...
1
vote
1answer
370 views

Packer with ansible from local works but from another server ask for root permissions

For a bit of context, I'm using packer with an ansible provisioner to create AMI images on AWS. The relevant parts of the packer and ansible: packer.json "provisioners": [{ "type": "shell", "...
0
votes
1answer
213 views

How to give Apache access to ip-tables on ubuntu

I've run the below script on a fresh Ubuntu 14.04.5 x64 box. It works to the point where apache blocks my IP address for too many requests as expected. However, my IP address isn't added to iptables. ...
1
vote
0answers
90 views

Debian 8; Run sudo in a screen session at boot without password prompt?

I want to create a startup/boot script that allows me to run a couple of Screen sessions. This I have been able to achieve through creating a script on /etc/init.d/bashfilehere But when I need to run ...
1
vote
0answers
281 views

How to give PAM authentificated users sudo powers?

I set up PAM linked to an openldap, and I want all the authentificated users to be able to use sudo. I thought I could create a posix group in the ldap called sudoersgroup, and write a rule in /etc/...
-1
votes
1answer
68 views

Sudo on UNIX. does not prompt for password for switching to other user [closed]

I configured sudo. But when i login to a user with sudo, it will prompt me for my password. However if I su to other user it will not ask me for a password. How do i tackle this? Please see the below ...
-2
votes
1answer
204 views

What is the purpose of the -Hu argument for sudo? [closed]

I've seen several sudo commands that begin as so: sudo -Hu apache What is the purpose of the -Hu argument, and how does it pertain to the apache command that follows?
2
votes
2answers
698 views

Can sudo affect the entire server or just the users account?

I recently spent quite a lot on a vps for my business and have begun setting up ssh and a cpanel account for each of my sites. I started to install composer on an account but need root privileges. My ...
1
vote
1answer
489 views

Pass parameter from Local to Sudo user [closed]

Ok if subject is not clear i will explain my doubt.I have a shell script kept at my local user called (executeAdM.sh), and when i execute this script i am connecting to SUDO user by taking commands ...
2
votes
1answer
3k views

Unable to restart a systemctl service remotely as a non root user

I have a systemd.socket named gunicorn.socket which I would like to restart after updating some code on a remote server. I've followed the steps detailed in Allowing a non-root user to restart a ...
0
votes
1answer
553 views

What is the difference between sudo command and sudo bash -c command?

Is there any difference between the two command? sudo su - root and sudo bash -c 'su - root' It seems a silly question but I believe there is some benefit on security by only allowing the second ...
1
vote
1answer
363 views

How to install Node.js and NPM on Unix server so that no users require sudo to install or read global packages?

Is this really such an uncommon situation that I can't find answers anywhere? Anyway. I have a Ubuntu VM server on DigitalOcean and I am running Jenkins on this server to do build, test and local ...