Visudo not working anymore, what can I do?
visudo
just a binary file with no built-in configurations, so you can safely replace it. Is included in the sudo
package, which you can reinstall by typing:
sudo apt-get install --reinstall sudo
And if you're inclined to learn how to use the editor you stumbled onto, try typing
vimtutor
If all you care to know is how to exit vi / vim without breaking anything, the way to do is to type :q!
visudo nopasswd not working
Try:
%admin ALL=(ALL) NOPASSWD: /usr/bin/java -jar /opt/myapp/myapp.jar
Permission denied after visudo nopasswd set for port command
You actually want to achieve two things:
1. Making it possible to run sudo port
without the need to enter a password.
You already solved that by adding the following line to /etc/sudoers
:
%admin ALL=(ALL) NOPASSWD: /opt/local/bin/port
2. Making it possible to run sudo port
without the need to explicitely type sudo
This can be done by an shell alias. Since the question is tagged bash
I assume your shell is bash. In that case modify your .bashrc
and add the following line:
alias port='sudo port'
Start a new shell and it should work.
Sudo NOPASSWD not registering/working/showing
To aide debugging and maintainability you should split your rules:
%groupname ALL=(root) NOPASSWD: SOFTWARE
%groupname ALL=(GROUPALIASNAME) NOPASSWD: APP
Splitting your rules onto different lines makes it clearer what you are trying to do.
Ensure that the user you are trying to run sudo as, is in %groupname
.
Ensure that you are using something like sudo -u user1
(etc) so the Runas_alias is actually effected.
The other thing you need to do, is if you are testing changes as the destination user, if you just added your user to %groupname
, you need to log out and log back in for the group add to actually work.
Related Topics
Sharing Stdout Among Multiple Threads/Processes
Docker - Is It Safe to Switch to Non-Root User in Entrypoint
How to Determine The Files Corresponding to a UInput Device
Using Git to Clone from a Windows Machine to a Linux Webserver (In House)
How to Use Sed to Delete Leading Digits
Opening Sockets to The Xserver Directly
Running R in Batch Mode on Linux: Output Issues
Using Google as a Dictionary Lookup via Bash, How Can One Grab The First Definition
Arm Performance Counters Vs Linux Clock_Gettime
Difference Between T and T in /Proc/Kallsyms
How to Use Performance Counters Inside of The Kernel
Making Strlcpy Available in Linux
In Bash, How to Not Create The Redirect Output File Once The Command Fails