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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

Questions tagged [sudo]

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

1
vote
3answers
44 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
50 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
79 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
25 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, ...
1
vote
0answers
28 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
88 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
80 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
20 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
55 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
11 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
28 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
148 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
52 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
76 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
479 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
37 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
31 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
164 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
678 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
120 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
170 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
81 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
20 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
591 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
51 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
85 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
468 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
40 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
61 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
73 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: /...
0
votes
0answers
209 views

The Right Way to install RVM on a Fresh Ubuntu Server

I am setting up a clean Ubuntu 16.04 machine to run rails. My first login to the machine is an SSH session as the sudoer ubuntu. I want to create a second user, say apprunner that does not have ...
1
vote
1answer
302 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
0answers
33 views

How to configure sudo for daily admin use?

What's the benefit of prefixing sudo to every command I need to run when 95% of what I do everyday requires root access? I've found sudo useful for rudimentary logging of who ran what, as well as ...
0
votes
1answer
197 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
87 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
217 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
64 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
166 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
682 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
377 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 ...
1
vote
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 ...
-1
votes
1answer
304 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
312 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 ...
0
votes
2answers
50 views

Linux permissions and status code 1

i have problem with linux (ubuntu 16.04) permissions and command execution. /etc/sudoers file: Defaults env_reset Defaults mail_badpass Defaults secure_path="/usr/local/sbin:/...
0
votes
1answer
289 views

Run a script as root from the user GUI [duplicate]

So, I have a script that needs to install a software but the script needs to be run as root. I have created a desktop icon on the GUI (using Ubuntu desktop) where ideally, the user will click this ...
1
vote
0answers
41 views

LDAP and User root/sudo on local netboot ubuntu/debian machine

I'd like to create a debian/ubuntu pxe netboot image authenticating against ldap but I want give the user the power to install software on his local machine. In Windows I simply add a local admin ...
-1
votes
1answer
114 views

Sudo not asking for password

I have a problem with my Antergos installation, when I try to sudo a command it won't ask root password: Also Ctrl + C won't stop the command. Can't connect to WiFi (Network manager is not running ...
-1
votes
2answers
5k views

Centos 7 - adding a user to sudoers group - still is not in the sudoers file - why?

[user@localhost ~]$ su - Password: Last login: ... [root@localhost ~]# usermod -aG wheel user [root@localhost ~]# exit logout [user@localhost ~]$ sudo echo 123 [sudo] password for user: user is not ...
0
votes
1answer
243 views

setting up root password in aws linux instance

we have setup the aws linux instances with ssh keys. Ubuntu user can be login with ssh key , sudo su - getting into root user without prompt password and set the password for root even though not ...