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

visudo edits the sudoers file in a safe fashion

2
votes
4answers
342 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 ...
1
vote
1answer
21 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 ...
0
votes
2answers
50 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 ...
0
votes
0answers
30 views

How can I fix broken sudo - sudo: parse error in /etc/sudoers near line 1 [duplicate]

I am a newbie to Ubuntu I tried to get rid off from asking password every time so I changed some line in sudoers file now I am stuck. How can I solve this?
1
vote
1answer
53 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 ...
0
votes
0answers
24 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 ...
2
votes
1answer
3k 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 ...
0
votes
1answer
56 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 : ...
0
votes
1answer
338 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 ...
0
votes
0answers
124 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 ...
0
votes
0answers
147 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/...
0
votes
0answers
338 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 ...
0
votes
1answer
124 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?
0
votes
0answers
331 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 ...
2
votes
1answer
593 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:...
0
votes
1answer
429 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 ...
0
votes
0answers
120 views

Getting “sudo: no tty present and no askpass program specified” even though I put user in my /etc/sudoers file [duplicate]

I’m using Ubuntu 14.04. I have edited my /etc/sudoers file to look like so Defaults env_reset Defaults mail_badpass Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/...
4
votes
2answers
188 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 ...
0
votes
0answers
31 views

How can I fix the sudoers file? [duplicate]

Quite frankly, I made a ouchy. I edited the sudoers file manually as root, and now I have an error after I tried to fix it (as root): visudo: /etc/sudoers busy, try again later I changed its ...
1
vote
1answer
259 views

Visudo - Change user without password doesn't work

I want a user to be able to change to another user without a password and any other root rights. I followed already a hint on https://apple.stackexchange.com/questions/82438/allow-sudo-to-another-user-...
0
votes
1answer
2k views

What is the difference between the group root and the group sudo? Why root user by default is not a member of the group sudo?

I am quite confused regarding this matter. As far as I know the user root has all the privelages. Also all the users of the group sudo has all privelages. But the user root by default is not a ...
0
votes
1answer
87 views

problems with sudoers

if I run sudo visudo I get this page: How can I fix?
16
votes
1answer
2k views

Get email notification for using 'sudo' by a specific user

I have a server set-up and I let somebody that I trust with a little bit of sudo access have it. However, I also want an email anytime that they use sudo. I know that I can use Defaults ...
0
votes
2answers
1k views

Visudo Command Not Working on Sudo User

I recently bought a vps and I have am fairly new to using ubuntu on it since I have always used shared hosting. I have created a sudoer user and it worked perfectly fine yesterday except when I ...
0
votes
1answer
1k views

Sudo doesn't recognize correct password [duplicate]

I tried changing my sudoers.d file to remove authentication from my pc by typing %admin ALL=(ALL) NOPASSWD:ALL without using visudo. However, after doing that anywhere where the sudo command is used, ...
1
vote
0answers
427 views

user in sudo group can't run sudo

I've seen other similar questions but they don't solve my problem unfortunately. I've been added to the sudo group on my Ubuntu 14.04 with usermod -aG sudo testuser but I still can't run sudo: :~...
0
votes
1answer
1k views

ubuntu drop to root shell prompt asks for password

I'm using ubuntu 14.04 and I messed visudo and now sudo code is not working. So, I tried to fix it but because I'm not root user, I can't access to visudo to fix what I messed. so I tried reboot and ...
1
vote
1answer
630 views

Upstart for docker and setuid permissions

OK, this has kept me busy for a day at least, since last night. I am trying to do something very simple: run a bash script which creates a few folders and runs a docker container - but using upstart. ...
1
vote
0answers
171 views

timestamp_timeout in Ubuntu doesn't work

I use ubuntu 14.04 and I tried to change sudo password timeout but change made to it doesn't work. Please help , My visudo file looks like this. GNU nano 2.2.6 File: /etc/sudoers....
2
votes
0answers
22k views

Sorry, user is not allowed to execute X as root on lt

Whenever I try to run a command from the termainal as sudo, I am now getting the error: Sorry, user {user} is not allowed to execute {command} as root on lt. lt is the name of my computer. The only ...
3
votes
2answers
817 views

Certain commands not working for a user with sudo after adding to `sudoers` file

I cannot seem to allow the user (In this case Ruby) to run sudo rm -rf, sudo rmdir, or sudo mkdir. I have tried it with other commands and it works fine allowing that user to run sudo apt-get update ...
2
votes
1answer
362 views

Explanation of visudo lock file

When I edit /etc/sudoers using visudo, I think it saves to sudoers.tmp, checks it for errors, then copies it to the real /etc/sudoers. However, I can't confirm my theory (how the lock file is used) ...
4
votes
1answer
1k views

Must use 'visudo'?

In /etc/sudoers, it says: # This file MUST be edited with the 'visudo' command as root. My question is, why must this file be edited with visudo? It seems I was able to edit the file successfully ...
3
votes
0answers
1k views

Reset sudoers file

I want to add a new user to run all commands without a password, so I went to edit /etc/sudoers (using visudo of course) by adding the line myuser ALL=NOPASSWD: ALL. Everything is OK, but 15 minutes ...
3
votes
1answer
19k views

sudo: can't open /etc/sudoers: Permission denied [duplicate]

sudo from a standard user works fine, but when I try to use it from root it returns this error: sudo: can't open /etc/sudoers: Permission denied sudo: no valid sudoers sources found, quitting /etc/...
0
votes
1answer
1k views

Allow nopasswd sudo for specific user

I am trying to set the scp as a specific user with NOPASSWD. alice ALL = (bob:ALL) NOPASSWD: /usr/bin/scp As I did understand from this question. However when I save using my visudo I still can't ...
3
votes
1answer
3k views

visudo: specified editor (./sudo_editor) doesn't exist

I tried to run the "sudo EDITOR=./sudo_editor visudo -f /etc/sudoers.d/relax_requirements" command and the error came out as: visudo: specified editor (./sudo_editor) doesn't exist Anyone know what ...
91
votes
2answers
82k views

How to change visudo editor from nano to vim? [duplicate]

When I use visudo, it always opens it with nano editor. How to change the editor to vim?
21
votes
3answers
10k views

Change the default editor when sudo visudo

When doing sudo visudo, the default editor is nano. I want to change it to vi or vim. I already made vim the default editor, and use it as a substitute for gedit to open php, .txt, .c and .h files,...
1
vote
2answers
1k views

Auto-starting a GUI application that requires sudo

Question: I need to auto-start a GUI application that requires sudo. I know I need to edit the sudoers file with: sudo visudo However, I don't know what to write in the file. What I already tried:...
1
vote
1answer
222 views

/etc/sudoers file problem understanding

According to the documentation, modifications of this file may enables local users to execute sudo commands on remote machines: user1 192.168.1.14=(user2:group1) ALL According to what I read, ...
1
vote
1answer
2k views

Changes to sudoers have no effect. Following basic Ubuntu tutorial

I'm following along the Ubuntu sudoers tutorial. Here's my exact /etc/sudoers file (screenshot instead of code block because the formatting was getting messed up). Notice the lines at the bottom ...
3
votes
2answers
7k views

Mount samba share at login using startup script (not fstab)

Background I'm trying to automatically execute a command that mounts a password protected Samba share when my user logs in. The catch is, I share my laptop with another user, and I don't want the ...
0
votes
1answer
214 views

Shutdown launcher withouth password

I added new launcher to panel using this command for shutdown: gksu telinit 0 When I wanted to get rid of constant inserting of password, I did not succeed. I opened visudo and added line "username" ...
1
vote
0answers
880 views

Lost visudo - I seem to have lost visudo, to my great surprise

Lost visudo I seem to have lost visudo, to my great surprise. I'm trying to add to /etc/sudoers or /etc/sudoers.d but when I try and run visudo as root I get this sudo: visudo: command not found ...
1
vote
2answers
1k views

Xubuntu visudo sudoers edit not working

I have been trying to specify a script that I would like to run without being prompted for a password. After a number of google and stack searches and a number of different syntax changes, I still ...
2
votes
3answers
1k views

Run a specific sudo command without a password in Ubuntu 13.10

I would like to run vagrant without being prompted for a password. As this post suggests, I used visudo to add the following line to my sudoers file. john-moz ALL=(ALL) NOPASSWD: /usr/bin/vagrant ...
1
vote
1answer
78 views

Changed suoders to an account that doesn't exist, what should I do

I've installed ubuntu 12.04 with single user, let's call him user1. I then created a new user, let's call him user2. I wanted user2 to be the only user with sudo rights, so I removed all users from ...
0
votes
1answer
105 views

Visudo not working for specified files

I am trying to give sudo ability without the need of passwords to specific files. So far I have: employee ALL=(ALL:ALL) NOPASSWD: /home/file_name The file has a simple chmod command, in the bash ...
0
votes
1answer
221 views

visudo crashing on making changes

I am attempting to add an entry to visudo: admin ALL=(ALL) /bin/kill I have attempted to make changes to this in the past but crashed the visudo file. Can someone assist in telling me where exactly ...