Skip to main content

Questions tagged [visudo]

visudo edits the sudoers file in a safe fashion

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

Edit /etc/sudoers file to mount cifs without sudo

I have Python scripts on a Linux server that mount cifs. They get executed via crond. I want to execute them via a specific user, but it will only do it with sudo or the root user. I tried to edit the ...
Florian's user avatar
  • 11
0 votes
1 answer
88 views

visudo command opens nano

I discovered that using the visudo command in Ubuntu results in opening Nano. This is not the behaviour I expect or that see when using CentOS or Darwin. I see that this topic is discussed here and ...
Cameron's user avatar
2 votes
2 answers
495 views

Why micro is not recognized as text editor in Ubuntu 22.04?

I installed micro with sudo apt install micro on 22.04 I want to use visudo with micro. export EDITOR=micro then next line visudo opens in nano. So, then I tried sudo update-alternatives --config ...
Pragmatic's user avatar
0 votes
0 answers
340 views

Sudoers, Specific Programs & Said programs arguments

I have a /etc/sudoers.d file which I want to run a program (asterisk) WITH arguments as a user (zabbix). So far I have tried: zabbix ALL = NOPASSWD: /etc/path/to/my/script.sh And zabbix ALL=(ALL) ...
Definity's user avatar
  • 123
0 votes
1 answer
322 views

My sudo password was completely showing on my terminal - Ubuntu 22.04

I'm using Ubuntu 22.04 on my laptop, on my PC is normal but with my laptop, everytime I input password for sudo it was showing on screen. I trying to edit in visudo but my password still showing on ...
JohnyDeen Agent's user avatar
8 votes
1 answer
1k views

Difference between "select-editor" and "update-alternatives --config editor"

I'm looking at how Ubuntu selects a default editor, and I notice that to set the default editor for editing crontabs, I use select-editor while to set the default editor for visudo I use update-...
geckels1's user avatar
  • 183
1 vote
1 answer
978 views

NOPASSWD option not working in sudoer file

I know this has been asked before, but I tried answers from dozens of other posts, and nothing is working. I've also used this on other servers successfully, so I'm not sure what I'm doing wrong this ...
Jared's user avatar
  • 113
0 votes
1 answer
83 views

In what line of sudoers do I put this?

%newgroup, !newuser ALL=(ALL:ALL)NOPASSWD:ALL, !/usr/sbin/iptables I have read that it is put at the end, but I am not sure about it
Dabro's user avatar
  • 1
1 vote
1 answer
205 views

Allowing {USER} to run a command against a process owned by another user

I have been scouring the forums to find out how you can allow a command / process to be ran by a user that is normally only permitted by root or itself. There are some good resources out there but ...
Doopz's user avatar
  • 131
4 votes
1 answer
3k views

systemctl still asking for password even with sudoers

My /etc/sudoers josh ALL=(ALL) NOPASSWD: /usr/bin/systemctl restart servicename.service running systemctl restart servicename.service still asks for password. Does anyone have any ideas? Running ...
Josh's user avatar
  • 105
0 votes
1 answer
205 views

I accidently removed visudo from /usr/sbin/ How do I recover it?

I was trying to install cypress in wsl. While I was following the official documentation of cypress to install in wsl, I accidently removed the visudo from /usr/sbin/ Without it I cannot install and ...
sunnyinho's user avatar
0 votes
0 answers
603 views

Visudo NOPASSWD not working on specific file

I'm trying to exclude one script I wrote from asking the password when executed, even if it contains a "sudo" command so i've edited sudoers through visudo adding myuser ALL=(ALL) NOPASSWD: ...
Gabriele Niola's user avatar
2 votes
1 answer
2k views

`sudo visudo /etc/hosts` gives syntax errors

Really dumb question, Ubuntu 20, and I have apache2 installed, not much else. I go sudo visudo /etc/hosts and want to add an alias "dummy.com" domain alias as a hack to point to the server ...
Conrad B's user avatar
  • 167
0 votes
1 answer
230 views

Trying to tweak my sudo configuration

so I am trying to tweak my sudo configuration(sudo visudo -f /etc/sudo.conf) but unfortunately the following errors appeared ??? /etc/sudo.conf:16:22: syntax error Plugin sudoers_audit sudoers.so ...
Zorono's user avatar
  • 41
-5 votes
1 answer
107 views

Why Ubuntu still hasnt fixed deleted passwords issue?

So after 6 years this question was posted I still ran into same issue. I did the followoing : myusername ALL=(ALL) NOPASSWD:ALL And it was going fine for some time so if I am installing any software ...
BiologyEnthusiast's user avatar
-1 votes
1 answer
84 views

visudo don't apply modifications

i'm on ubuntu server I'm trying to use a command sudo /usr/binsystemctl start myscript.service Without password. i want this command execute without ask password. I used sudo visudo and writed : ...
Eva exe's user avatar
  • 17
0 votes
0 answers
139 views

Ubuntu 21.04 Broke Passwordless SSH Shutdown

I recently had passwordless SSH shutdown and reboot working on Ubuntu 20.04, but after upgrading to Ubuntu 21.04 it no longer works. I have key based authentication set up correctly, and can ssh into ...
Mmm's user avatar
  • 1
1 vote
0 answers
50 views

Allowing a sudo command to run without needing password [duplicate]

I have the following command: sudo service cron start When I type it into the terminal, it asks me for a password, just as it should. But I need for users (or if all users aren't possible, then at ...
Askerman's user avatar
  • 847
0 votes
1 answer
2k views

How to give passwordless sudo through automated script

Anyone who has used Multipass or AWS is familiar with the ubuntu user who has passwordless sudo access. I am launching multiple virtual machines via multipass each with many users and I want ...
francistheturd's user avatar
0 votes
1 answer
356 views

How to bypass sudo password for everything inside a script?

I have a PADD setup on my Raspberry Pi 3 running on Ubuntu Server 20.04. I can successfully bypassed sudo password authentication by adding: pihole_display ALL=(ALL) NOPASSWD:ALL But when I try to ...
YamiYukiSenpai's user avatar
4 votes
1 answer
944 views

user not in sudo group but can perform sudo operations

Is this normal behaviour when I put a user student in sudoers file using visudo command like this : visudo student ALL = NOPASSWD: ALL And he is not in sudo group but can still perform sudo ...
Tomas.R's user avatar
  • 433
0 votes
1 answer
99 views

Configure sudo for UserA to run commands as UserB (not root)

I have some automated tools that need to be able to run as a specific user. The username is "ig_root" and it is only used by a monitoring tool (checks disk space, database, CPU workload, etc)...
S. Nixon's user avatar
  • 421
0 votes
2 answers
4k views

Give root permissions to new user

I have created a "normal" user with sudo privileges, lets say newuser. I created with the GUI Users and Groups and created as administrator. If i want to install a new program or whatever ...
Eduardo Gutierrez's user avatar
1 vote
1 answer
189 views

Messed up the sudo access!

Not sure if this is the place for troubleshooting, but I am gonna give it a shot. I was trying to make my computer turn off without needing sudo, and I must have done something wrong because I get a ...
misas's user avatar
  • 11
1 vote
1 answer
2k views

Adding my user to sudoers does not work. Still ask for password

I have a fresh install of Ubuntu 18.04 I made the mistake of editing /etc/sudoers with "vim" first instead of using "visudo". Therefore when I was doing "sudo command" it kept asking for my password. ...
Alain Star's user avatar
2 votes
1 answer
633 views

sudoers doesn't work

I added powertop to /etc/sudoers (sudo visudo) but it doesn't work. I checked all possible problems I can imagine. What did I missed? user@ellie:~$ whoami user user@ellie:~$ groups user adm cdrom ...
Arno's user avatar
  • 485
0 votes
1 answer
669 views

What should /etc/sudoers contain normally? [duplicate]

When I run sudo visudo , what should it contain? Please give me an example of what it should have normally for a sudo user.
Ubuntovative is here's user avatar
0 votes
1 answer
1k 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 passwd ...
Tomas.R's user avatar
  • 433
1 vote
1 answer
762 views

How can I run a sudo command as sudo (!) without password? (cryptsetup needs to be run as sudo in order to use kernel module 'device-mapper')

Solved Besides not commenting the #includedir line in /etc/sudoers out, editing sudoers.d/myOverrides with sudo visudo -f /etc/sudoers.d/myOverrides, and using the syntax I first tried, did the ...
hghtch's user avatar
  • 13
1 vote
0 answers
704 views

Root user access for another user [duplicate]

I am trying to gain root user access to another user so that I can run a command with adding sudo in front of any command. Example: fdisk -l Getting the error message as: fdisk: cannot open /dev/...
user497091's user avatar
0 votes
1 answer
988 views

user is not in the sudoers file

Once configured my VM with Ubuntu 18.04 and joined to an AD domain, when trying to do sudo operation with my domain user, the error message is always: "domainuser is not in the sudoers file. this ...
MostosiAndrea's user avatar
0 votes
1 answer
1k views

/etc/sudoers is owned by gid 33, should be 0, and when I try pkexec I get "authentication failed"

I was trying to get access and write permissions to my apache sites-available folder over ssh/sftp. I didn't really understand what I was doing to be honest and ran the following commands: $ sudo ...
codemonkey789's user avatar
0 votes
2 answers
1k views

How to run "systemctl" + $ + "apache" $=stop,start,restart as non sudo/root user?

Yeah basically the title, I want to do that things from a app that can run Linux scripts per SSH. I only want to run these three and not ALL from systemctl with my basic user. So thanks.
Just a dude's user avatar
0 votes
1 answer
1k views

Can't grant myself permissions to execute `rm` command as sudo

I have a user account on my machine: $ (whoami) > foo_user I've updated by /etc/sudoers file to grant myself permissions to use the rm command: User_Alias OPERATORS = foo_user Cmnd_Alias ...
dopatraman's user avatar
3 votes
4 answers
10k views

How to allow a command to be executed for a particular user without password with sudoers file?

Can anyone please explain the exact work of these in /etc/sudoers ? (I've done some research, so please don't share any links) I want to add myself (member of sudo) to execute a command without ...
Purnendu Nath's user avatar
1 vote
1 answer
624 views

Can I edit the sudoers file with visudo using my bootable USB

Something I did with a sudo dpkg ... installation in an attempt to fix problems with my audio clobbered my ability of my sole user-name to run sudo in 18.04 LTS (Bionic Beaver). This is a single OS ...
WhereIsTheManual's user avatar
2 votes
2 answers
6k views

Can't run visudo within Docker; sudoers file does not exist

Ubuntu n00b here. I am tinkering with a Docker container that I created using the following simple Dockerfile: FROM ubuntu CMD ["tail","-f","/dev/null"] Inside the container, as the root user, I try ...
Shaul Behr's user avatar
1 vote
1 answer
1k views

I have somehow locked or removed my access to sudo - how can I fix it? [duplicate]

I am fairly new at Ubuntu system and commands. I was trying to follow some tutorial online explaining how to setup using no password to download apps. I was in visudo, and next thing I know I can't ...
Mike Dugger's user avatar
1 vote
0 answers
526 views

In which cases multiple hostnames are set/uses with sudo

My computer has a label/hostname, let's say learn_linux. In the /etc/sudoers the format is: user ALL=(ALL:ALL) ALL %group ALL=(ALL:ALL) ALL the first field -> user, %group is referring to ...
user3541631's user avatar
4 votes
1 answer
25k views

Add user to sudoers

I want to add a user account to sudoers. I type in sudo usermod -aG sudo username Then I reboot. I type apt update I get permission denied. I type sudo apt update Followed by account ...
rob18767's user avatar
0 votes
1 answer
77 views

Configure a group to change date via GUI without admin privileges

On Ubuntu 16.04, I would like to create a group of users, named "group_1", without admin privileges who would be able to change the date. To do so, I use the command visudo and add the line : ...
user3745424's user avatar
0 votes
1 answer
921 views

how to edit sudoers file and pass a file which contains list of commands instead of commands list in sudoers file

I need to edit visudo file to allow users to access certain commands. If i edit visudo file to add some commands, then i have to edit visudo file very frequently . Instead of editing visudo file I ...
Mohan's user avatar
  • 101
0 votes
0 answers
418 views

WSL: visudo -c complains "parse error"

I'm having a problem trying to set a sudoer file in WSL. So, I created a file /etc/sudoers.d/wheel containing the following one line: %wheel ALL = NOPASSWD: (ALL:ALL) ALL But whenever I run visudo ...
pepoluan's user avatar
  • 745
0 votes
0 answers
476 views

How can I configure visudo to run a script with root privileges for a non root user?

I need than a deployer (member of group deploy) can run some scripts with root priviegies. But I dont want that deployers can run anythig. I try this. With a root user I do: ~$ echo "touch /opt/expe/...
Emilio Platzer's user avatar
0 votes
0 answers
879 views

sudo environment variables disappeared

Symptom: user1@ubuntu:~$ printenv PATH /system/company/root/bin:/usr/lib/icecc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/system/company/scripts:/opt/puppetlabs/bin ...
Thomas G. Lau's user avatar
0 votes
1 answer
782 views

Changing visudo caused a problem with sudo [duplicate]

I added something in visudo and now when I want to run sudo it gives me the following error: Sorry, user reza is not allowed to execute '/bin/su' as root. What should I do?
Reza Namakin's user avatar
0 votes
0 answers
1k views

Avoid password prompt while using minicom

I have the following python code where I am trying to open the device /dev/ttyUSB5 using minicom: import serial import os b1_ser_port_num=5 cmd="/dev/ttyUSB"+str(b1_ser_port_num) print "We are now ...
skrowten_hermit's user avatar
3 votes
4 answers
12k views

Change in sudoers does not take effect. Ubuntu 16.10 fresh install + one line.

Trying to remove password on sudo. My current sudoers file: Defaults env_reset Defaults mail_badpass Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:...
Vidar's user avatar
  • 41
1 vote
1 answer
5k views

What is the purpose of group privileges in sudoers file?

I removed my regular user from the sudoers file but it is still part of sudo group which has all privileges granted in the sudoers file. When I try to execute any command in sudo from my regular user ...
enu's user avatar
  • 177
6 votes
2 answers
1k views

How to see what pkaction a software uses

So, I have one software that always asks for password when starting. And I want to run this software without this gksu password prompt popping up everytime. The first thing I tried was adding its ...
PKM's user avatar
  • 829