Questions tagged [visudo]

visudo edits the sudoers file in a safe fashion

Filter by
Sorted by
Tagged with
0
votes
1answer
30 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 ...
0
votes
1answer
48 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 ...
3
votes
1answer
94 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 ...
0
votes
1answer
30 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)...
0
votes
0answers
12 views

sudo timout not working consistently for me

Is there some logic as to when the timeout might reset differently than what is in visudo? I am using 20.04 (but have seen this in previous versions too) and I have set my visudo to this Defaults ...
0
votes
2answers
190 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 ...
0
votes
0answers
49 views

unable to create file in the www directory after installing apache2

I created aapache2 like this sudo apt install apache2 after installing, i started apache and checked the browser that does it load and yes, it works fine after that i did this sudo mkdir /var/www/...
0
votes
0answers
15 views

Added new file /etc/sudoers.d/ getting some error in standard error stream while executing the command

The content of /etc/sudoers.d/my-comm ALL =(myuser) NOPASSWD: /export/home/subhajit/mycommand.sh Without this new sudoer mycommands.sh prompts for password ([sudo] password for myuser). When adding ...
1
vote
1answer
98 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 ...
0
votes
1answer
238 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. ...
1
vote
1answer
354 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 ...
0
votes
1answer
181 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.
0
votes
1answer
148 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 ...
1
vote
1answer
375 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 ...
1
vote
0answers
131 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/...
0
votes
1answer
449 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 ...
0
votes
1answer
329 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 ...
0
votes
2answers
542 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.
0
votes
1answer
821 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 ...
2
votes
4answers
5k 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
191 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 ...
2
votes
2answers
3k 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
31 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
142 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 ...
1
vote
0answers
188 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 ...
3
votes
1answer
19k 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
63 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
655 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
320 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
252 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
649 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
341 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
793 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 ...
3
votes
2answers
4k 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:...
1
vote
1answer
2k 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 ...
4
votes
2answers
514 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 ...
1
vote
1answer
496 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-...
2
votes
1answer
4k 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
233 views

problems with sudoers

if I run sudo visudo I get this page: How can I fix?
16
votes
1answer
3k 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 ...
1
vote
2answers
2k 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
5k 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
791 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
2k 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
760 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
1answer
398 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
26k 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
1k 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 ...
3
votes
1answer
832 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) ...
5
votes
2answers
3k 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 ...