Questions tagged [sudoers]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
0answers
21 views

Is it possible to run a script which requires elevated permissions from inside zshrc without password prompt

I am trying to put a script in my .zshrc that alters the fn key settings on my keyboard. This is done by altering a value inside a read only config file, and I have successfully done it with the ...
0
votes
2answers
61 views

Debian - user is not allowed to execute '/usr/sbin/reboot'

So I installed Debian 10.9.0, graphical install, logged in as the user I created. I can't do sudo commands with that user. (not in sudoers group) So I do su, type in the password. Then do sudo ...
1
vote
0answers
36 views

Sudoers: alias already defined “<garbage>”

I defined the following file in /etc/sudoers.d/50-apps Cmnd_Alias APPS=/usr/bin/systemctl start app-*, /usr/bin/systemctl stop app-*,\ /etc/init.d/app1, /etc/init.d/app2 Cmnd_Alias ...
0
votes
0answers
8 views

Changing Hostname in sudoers file

So i got a sudoers file containing a NOPASSWD. Though somehow my laptop decides to change its hostname whenever it goes offline. (user hostname.home = (root) NOPASSWD: /path/to/smth/) I thought about ...
1
vote
0answers
171 views

FreeNAS remote shutdown

I want to write a program that remotely shuts down my TrueNAS server. When I enable sudo for the user myuser, the command ssh myuser@hostname -t "sudo poweroff" is actually enough. But I don'...
0
votes
1answer
22 views

usermod command is not working despite giving permission in sudoers file

i have given linda user to run 2 commands (useradd & usermod) from the sudoers file, i successfully ran the useradd command but the problem is i can not run usermod command, i have checked ...
0
votes
0answers
58 views

How does google cloud setup sudoers for googlecloudshell user without adding it to the /etc/group file

I am not a new user on unix and linux. Before today I know everything works needs a logical configuration to make it work. But today, when I create ubuntu instances on google cloud, I found something ...
2
votes
2answers
471 views

Where is the sudoers file on Debian 10?

There is a server that was setup a while back, and I need to change a few settings, one of which is a user with super user privileges. However, everywhere I look tell to use visudo, or edit /etc/...
0
votes
0answers
10 views

How to permit users from group to start and stop services defined by service template?

I am setting up a game server on a Linux server and as a challenge to myself I wanted to create a group of users that could act as server administrators, and particularly give them permission to start ...
0
votes
1answer
112 views

Let a single user execute a command without sudo password

I have already searched and found the many answers to this, but I still can't get it to work. This is on a debian 9 system - I have created an alias and a shell function in the profile: alias lscron='...
0
votes
0answers
33 views

Not able to execute mycommand.sh as myuser without giving password whenever I run the command as myuser/root/anyotheruser

In /etc/sudoers.d/app-sudo file contains the below content. ALL ALL=(myuser) NOPASSWD: /export/home/subhajit/mycommand.sh mycommand.py contains a command as below which should run as myuser: sudo ...
2
votes
0answers
541 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
149 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
227 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
750 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
1k 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
249 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
18 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
145 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
27 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
256 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
4k 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
5k 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
394 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
1answer
824 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
1answer
2k 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
217 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
52 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
771 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
31 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
477 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
124 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
206 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
7k 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
8k 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
620 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
37 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: ...
1
vote
2answers
4k 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 ...
1
vote
2answers
11k 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
84 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
45 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
270 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
784 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
80 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
1k 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
103 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
872 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
786 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
40 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 ...