Questions tagged [sudoers]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
49 views

Auto mount veracrypt partition after login - without root password

I'm working on a debian-based linux machine (MX linux), trying to automate the mount process for a veracrypt encrypted partition, right after user login - and it won't work and i don'k know what to do ...
0
votes
1answer
48 views

remote execution of command failing due to sudo issue

i am running a command from my server which would remotely ssh to by client machine as root and sudo as olcne user and run few commands for validation. I have added the olcne user in sudoer list. i ...
1
vote
2answers
51 views

linux sudoers not work on command `su`

I want to disable command sudo and su for user in group staff. So I put this in /etc/sudoers: %staff ALL=ALL, !/usr/bin/sudo,!/usr/bin/su But I found, only sudo work, su still work for user in ...
2
votes
1answer
186 views

sudo -l and sudo -ll output

sudo -l gives me output: User test may run the following commands on server: (root) NOPASSWD: /usr/bin/vim /usr/bin/motd sudo -ll gives me output: Sudoers entry: RunAsUsers: root Options: !...
0
votes
1answer
184 views

Solved - sudo into user instead of root with rundeck

i'm configuring a server for some bioinfo analysis on Centos7 and i installed rundeck. Rundeck seems to launch scripts as its own account name and i decided to use the sudo bypass to make it access my ...
0
votes
2answers
98 views

Parse error in sudoers after giving sudo access without password

I am making a desktop application for Linux that interacts with some Ubuntu system files. As such, during the end-user's installation of my software, I need to generate a file in /etc/sudoers.d/ ...
1
vote
0answers
12 views

sudo asks password although there is nopasswd parameter [duplicate]

I edited the sudoers file like below: myuser ALL=(ALL) NOPASSWD: ALL newuser ALL=(ALL) NOPASSWD: ALL There is no another line that contains "myuser" in sudoers file. But ...
0
votes
1answer
74 views

Add a user with permissions to install programs but without permissions to access the directories of other users

I need to create an user in a Linux system with permissions to install programs but without permissions to access the directories of other users. I've tried to do this: # Create restricted user user ...
0
votes
1answer
24 views

Debian - Let service read protected file

First things first, OS: Debian 10 I've created a systemd service that runs at startup. It needs to be able to read from a file that needs to be protected. Correct me if I'm wrong, but it seems like a ...
0
votes
1answer
96 views

a change with visudo doesn't work

I issue visudo command, add this rule to the very end of the file, save the file and quit. newuser ALL=/usr/sbin/useradd However newuser is still able to run such commands as sudo touch file1 ...
1
vote
1answer
548 views

Changed root / file ownership, any way back?

I have made a typo and ran chown -R username /* instead of ./* as a root, and messed up everything. Now, can't login as a root and change the ownerships back. Any way to repair without having to ...
1
vote
2answers
948 views

Can someone explain what is `<user> ALL=(ALL) NOPASSWD:ALL` does in sudoers file?

I know that that line above allows <user> to run sudo command without having to type in the password. But what does the syntax actually mean? If you can link to an article then that would be ...
0
votes
1answer
134 views

sudoers sudoedit recursive wildcard

I want to allow editing any file (recursively) under specific directory via sudoers. None of the below works (Debian 9 sudo) ops ALL=(root) NOPASSWD: sudoedit /opt/myapps/ ops ALL=(root) NOPASSWD: ...
0
votes
0answers
296 views

SUDO does not recognize passwords

The problem is that I cannot use the sudo command because the system recognizes neither the root password nor the current user's password. There were some people that had a similar problem but in my ...
0
votes
0answers
56 views

Locking down sudoers when using multiple /bin/bash commands

We are performing vulnerability assessment scans against a Ubuntu server. I'm trying to lock down this scanning account with least privilege and only grant the commands the tool requires to do it's ...
0
votes
1answer
345 views

Unable to use sudo

I'm connecting via SSH to a Centos 7 machine. I have a user that cannot perform any command as super user. If I do: $ sudo ls / I get the error: "sudo: unable to fork: Resource temporarily ...
0
votes
0answers
1k views

Allow php to run shell script with sudo permission

command php -v is working when I execute simple shell_exec('./script.sh'); but when I use sudo it doesn't work without sudo service stop command is not working. var_dump(shell_exec('sudo bash ./...
0
votes
1answer
83 views

grant access to a command only for certain arguments (chown for a path)

I have a script that require to change the owner recursively in a folder there is my specific sudoers file: /etc/sudoers.d/jenkins jenkins ALL=(ALL) NOPASSWD: /bin/chmod, /bin/chown and this is the ...
0
votes
1answer
41 views

How to fix script to umount device without password?

I have added a file named: umountscript to /etc/sudoers.d/ with this directive: xikri ALL=(root) NOPASSWD:/home/x/umountscript.sh inside umountscript.sh I have this code: umount /mnt/devicex But ...
1
vote
1answer
556 views

Abuse suid program

I have some questions about setuid binary. I know it exists some dangerous program (if you permit to use this program with sudo, it is possible to escape from the program and get a root shell) like ...
0
votes
1answer
28 views

Sudoers Command

I can't understand the difference in this two command's USER ALL=(ALL) NOPASSWD: ALL AND USER ALL=(OTHERUSER) NOPASSWD: ALL Can anyone explain the () change? Thanks
1
vote
0answers
398 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
95 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
125 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. ...
1
vote
1answer
4k 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 ...
7
votes
2answers
6k 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
346 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
34 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
2answers
2k 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
8k 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
77 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
41 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
238 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
570 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
75 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
2k 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
805 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
99 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 ...
1
vote
1answer
664 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
698 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
35 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
81 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
2k 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
87 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
270 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
113 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
1k 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
456 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. I ...
2
votes
2answers
2k 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