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 [sudoers]

The tag has no usage guidance.

1
vote
0answers
39 views

Error installing Sudo on Debian

I'm trying to install sudo on Debian. At first I logged as root and then apt-get install sudo when I open nano /etc/sudoers it is an empty file. Here is a screenshot of my apt-get install sudo. Does ...
0
votes
0answers
36 views

sudoers: can´t run 2 command lists where the second has a glob * and denies the first

so, what I want is: to be able to run /sbin/print/managequeue.sh -p app1 --view as another user without asking password. to be able to run /sbin/print/managequeue.sh -p app1 --cancel (or --delete, ...
0
votes
0answers
36 views

Sudoers Argument Parsing using Python

I am working on a project and I need to be able to limit the command line arguments for commands when they are called with sudo. The parsing we are doing is big enough that using glob would be painful,...
0
votes
0answers
40 views

Locked out while setting up nginx

It's my first time trying to setup a web server. I was trying to set up a Digital Ocean Droplet running CentOS. During nginx setup, I 'accidentally' changed the permission of '/' to the nginx user, ...
0
votes
0answers
23 views

Rhel - How to create non root user, to administrate app installed by root?

Installed Syslog-NG as root, because the syslog-NG and its dependency packages like Eventlog is supposed to be installed in custom folder /app/syslog-ng. But, going further, we would like a non-root ...
0
votes
0answers
42 views

Su/sudo not working consistently

I am running Debian on a Lenovo x220 and upgrade my packages quite regularly. I discovered recently a change in the way how I elevate with sudo. Normally I just su or sudo stuff like e.g. arp-scan -l. ...
0
votes
1answer
254 views

How to avoid “root is not allowed to run sudo”?

I am trying to execute some third-party installer script (ansible tower setup.sh) which needs to be started as root or via sudo as some of the commands rely on root privileges. However some commands ...
5
votes
2answers
2k views

Sudoers NOPASSWD for single executable but allowing others

Operating System: Arch Linux Linux version: 4.16.11 Sudo version: 1.8.23 What I need: be able to execute any executable with a sudo with a password prompt be able to execute one executable, /home/...
0
votes
1answer
71 views

Is there something like a sudoers list in Windows?

In UNIX-like systems, normal users can obtain higher priviledges using the sudo command (or they can temporarily switch the user using su). However, with a properly configured sudoers and PAM file, ...
2
votes
1answer
30 views

Adding elevated permissions to scripts in a directory

I have a directory containing some scripts which I need to invoke from a web request. The scripts need elevated permissions to run. My current thinking is to add the following lines to /etc/sudoers: ...
0
votes
1answer
391 views

sudo inside docker (on fedora) ask for password, on host it doesn't ask password

I am testing something in docker, it requires sudo without entering password, I added required entries in /etc/sudoers. After that in host it doesn't ask for password. But in case of docker it still ...
0
votes
2answers
2k views

How to repair /etc/sudoers on OSX High Sierra

How I got here I installed an SSD drive after backing up my data. I installed OSX Maverick (because my laptop is circa 2014), and then I started copying over my data from user-2 to user-1 (because my ...
1
vote
1answer
53 views

What is the purpose of %{seq} in sudo/sudoers?

I have the ability to configure IO logging for sudo by setting iolog_dir, and according to the sudoers man page, these are the following variables I can use: %{seq} expanded to a monotonically ...
0
votes
1answer
23 views

How in sudoers verify specific input adding to the script

I have one script that is taking as an input IP address. My question is, can I specify in sudoers what input can be added to my script. Now I'm doing like that: user ALL = !ALL, /bin/sh, /home/user/...
1
vote
1answer
144 views

sudo -u <user> <cmd> vs sudoedit

I have read on the internet that you have to use sudoedit instead of sudo vim. I understand why this is and should be used so you can't just edit root-user files. However I would like to manage a ...
0
votes
1answer
189 views

Why is root sometimes not in the sudoers file, by default or convention?

On many varieties of Linux and Unix, the root user is not allowed to use sudo. Why is this? Is there any security concern with the root ALL=(ALL) ALL present in some other varieties' default ...
0
votes
1answer
62 views

root last chance to save server (sudoers file broken)

I know it's quite dumb to edit the /etc/sudoers file with nano and not visudo, but I did it and got an Syntax error :( . I have the root password and tried to login, but the root user is set to bin/...
0
votes
1answer
1k views

command run with root but not with sudo

I am running supervisorctl command with root and without root user. With root user it is ok but with sudo it is not working. Here is the output: [ec2-user@stg etc]$ sudo supervisorctl status sudo: ...
0
votes
2answers
371 views

Restrict sudo -i or sudo -s commands from sudoers file

Is there a way to restrict the following commands sudo -i or sudo -s in the sudoers file? When I add !/usr/bin/sudo -i or !/usr/bin/sudo -s, sudo still allows users to run the command.
0
votes
1answer
77 views

Permit user to switch to application user in sudoers

As an effort to extend security on our main job server I would like to tinker around with rights and restrict all useless permissions. Especially bothers Jenkins running as jenkins ALL=(ALL) bothers ...
0
votes
1answer
254 views

How to run a command with sudo from a certain path?

I'm setting up some automation with remote controlled bots. It's imperative that these bots have only exactly the permissions to run certain commands (I can't open the permissions too much in the ...
0
votes
1answer
308 views

sudo bash -c gave permission denied

In my linux (centos 7), there are 2 users A (normal user) and B (belongs to wheel group). I am trying to change User A's .bash_profile file by running the following command with user B. ./test.sh /...
0
votes
1answer
33 views

Why when I try to change user I obtain this error message? “myusername is not in the sudoers file”

I am not so into Linux and I have the following problem. I have to change user (using a given user) on a Linux server. So I use the [myusername@myserver~]$ sudo -i -u otherusername [sudo] password ...
1
vote
1answer
65 views

File Modification Restrictions for Sudo/Linux as in UAC/Windows

In Windows UAC, if the user attempts to run an executable file, the OS will prompt the user whether or not they intend to run it. Similarly, if the application requires admin privs, the user is ...
1
vote
1answer
1k views

Sudo doesn't work: “/etc/sudoers is owned by uid 1005, should be 0” - Ubuntu

When I tried to change the user to root using sudo su command. it shows the below error. Is there away to solve this issue? dasitha@dev-digin-io:~$ sudo su sudo: /etc/sudoers is owned by uid 1005, ...
1
vote
2answers
66 views

binding root pass into sudo command

is it possible to to have a sudo command executed with the admin password? example : sudo apt-get update -password is 'root' this is to put a command into an application on the startup of Ubuntu ...
0
votes
1answer
194 views

How to add myself back into sudoers in Ubuntu 14.04?

I have just updated the software, which included replacing the sudoers file. Having noted the line in the file for myself, I expected to be able to edit it and put myself back. I was wrong - it ...
0
votes
2answers
71 views

howto use passprompt_override in sudoers file?

I had, on a prior machine, used passprompt_override in the sudoers file to change the prompt to: ENTER NUCLEAR LAUNCH CODE: (instead of the old boring enter password:) But now, for the life of me, I ...
1
vote
1answer
758 views

How do I add to sudoers.d from a custom rpm

I have a custom RPM I created that needs to add entries to sudoers so I have entries added a file in my RPM /etc/sudoers.d/mypackage and put my sudo commands in there. The files gets added and the ...
1
vote
1answer
1k views

Mac OS X El Capitain can't sudo

Getting this error when trying to sudo on a mac I just received from work. sudo: can't open /private/etc/sudoers: Permission denied sudo: no valid sudoers sources found, quitting I tried disabling ...
1
vote
2answers
286 views

/etc/sudoers set user to have general sudo use, with no password prompt for only one commands

I have an entry in /etc/sudo for a user who can execute sudo for all commands. fred ALL=(ALL:ALL) ALL As per the documentation the final ALL is responsible for allowing access to all commands. ...
1
vote
2answers
1k views

What is the different between giving user root privileges and adding it to root's group

In Centos 7 I use visudo to grant root privileges, and I'm wondering what is the different between: myuser ALL=(ALL) ALL and # usermod -aG wheel myuser
2
votes
1answer
86 views

Why am I able to switch user only using hyphen?

If I try to switch the user using sudo su - kshitiz it works, and doesn't ask me for any password. But if I do sudo su kshitiz it asks me for that user's password. Why is this? I understand that ...
0
votes
1answer
145 views

Unable to get sudo lecture working on CentOS 7 server

I'm trying to enable the sudo lecture every time someone executes sudo, but I can't seem to get it working at all. I found a similar question here, in which someone states that if you don't see any ...
1
vote
1answer
444 views

Sudo user is not able to export path of ant

Sudo user is not able to export path of ant. I am trying to execute shell script setpath.sh which exports path for ant. After executing the script when I am executing ant command then getting ant ...
1
vote
2answers
1k views

Running script that has sudo commands with sudoers

I wrote a script that helps clean up my downloads and anime, but it won't run without root. So I tried adding it to /etc/sudoers (edited using techraf's suggestions): # This file MUST be edited ...
0
votes
1answer
762 views

Corrupted sudoers file preventing me from using sudo

I attempted to add another user to the sudoers list on my Raspberry Pi running Debian (Raspbian Jessie kernel ver 4.1). While doing so I entered the entry in wrong and I keep getting these errors ...
0
votes
1answer
874 views

sudo to any user without a password

If sudo can be configured to no password such as: bob ALL=NOPASSWD: ALL Then how can you configure sudo to be able to sudo to any user without password ? So that sudo -u domainnameuser.com mkdir ...
0
votes
0answers
101 views

Bricked my Ubuntu server can no longer start nor login anymore

I installed a virtual host (KVM) with Ubuntu Server 14.04.3 LTS. Now I spend the last week setting up apache, modules owncloud and other stuff. However, everthing worked great until I followed the ...
1
vote
3answers
1k views

Disable startup program super user authentication

I want my VPN to run on startup after logging into my user account. Currently running Ubuntu 15.10. I have added the program to startup (/usr/bin/mullvad); however, it asks for authentication before ...
4
votes
1answer
741 views

Why are sudoers not defined by UID?

Login information is tied to UIDs in Linux. However, when I open the sudoers file the sudoers are defined by username instead of UID. Why are used usernames instead of UID? Does the sudoers file ...
1
vote
1answer
1k views

Restrict access to directory with sudo

If I have a folder at /var/secret/ and give a user access to the sudo command, is there a way to allow them to have full access to everywhere else, BUT /var/secret/ and give them absolutely no access ...
0
votes
1answer
84 views

Meaning of parameters in sudoers file in RedHat

HI can you tell me what is the meaning of each and every parameter meaning of this line of sudoers file in RedHat machine? steve CSNETS = (operator) /usr/local/op_commands/ I know first ...
1
vote
1answer
46 views

Root Privileges and Risky Commands

user ALL=(ALL) /usr/bin/vim /etc/httpd/confs/httpd.conf user ALL=(ALL) /usr/bin/less /etc/httpd/confs/httpd.conf I think if these scripts are written in sudoers, "user" can cause problems on the ...
1
vote
0answers
342 views

sudo --set-home decide based on command

I was wondering if there is a way to make sudo set the --set-home flag based on the command being executed. e.g. in most cases I do not want the --set-home flag to be set, but for npm, I want it to ...
1
vote
1answer
968 views

no valid sudoers sources found after running sudo chmod -R 777 /etc on AWS

As I said, I did a stupid thing on Amazon Web Services. sudo chmod -R 777 /etc` which gives this when using sudo: sudo: /etc/sudoers is world writable sudo: no valid sudoers sources found, ...
0
votes
1answer
202 views

sudo NOPASSWD for particular paths

How can I enable NOPASSWD for a user to do anything in several paths? For instance read/write/execute any file in /etc/init.d and /opt/?
1
vote
0answers
158 views

PYTHONPATH variable can't be echoed by non-root

I edited my sudoers file by getting root privilege as sudo -i Then I edited my sudoers file by nano /etc/sudoers I added Defaults env_keep += "PYTHONPATH" to the sudoers file. Then from root, I ...
3
votes
2answers
7k views

`sudo adduser username admin` leads to `adduser: The group `admin' does not exist.`

I'm trying to add a user to the sudoers file with the simple command sudo adduser username admin but I get adduser: The group 'admin' does not exist. So I checked out the sudoers file (sudo visudo -...
0
votes
1answer
39 views

Make a group be able to run shutdown command without entering a password (CentOS)

I used the command visudo -f /etc/sudoers to edit the sudoers file. How do I make a group be able to run the shutdown command without supplying password?