Questions tagged [visudo]

visudo edits the sudoers file in a safe fashion

Filter by
Sorted by
Tagged with
314 votes
18 answers
560k views

How to modify an invalid '/etc/sudoers' file?

How do I edit an invalid sudoers file? It throws the below error and it's not allowing me to edit again to fix it. Here is what happens: $ sudo visudo >>> /etc/sudoers: syntax error near ...
user avatar
48 votes
3 answers
17k views

What are the differences between sudo, su, visudo, chroot, and gksu?

What are the differences between sudo, su, visudo, chroot, and gksu ?
lambda23's user avatar
  • 3,232
37 votes
4 answers
22k 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,...
Cbhihe's user avatar
  • 2,761
211 votes
2 answers
229k 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?
dedunu's user avatar
  • 9,186
10 votes
3 answers
7k views

Why I must use 'visudo' to edit the '/etc/sudoers' file?

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 ...
Tosh's user avatar
  • 409
3 votes
4 answers
9k 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
2 votes
3 answers
2k 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 ...
John Karahalis's user avatar
-10 votes
1 answer
3k views

How to sudo visudo without a password, remove all prompts for password [closed]

Websites tell me to use sudo when I have no password, usually tell me one of two things. It is bad security Or use 'sudo visudo' and the %admin ALL=(ALL) NOPASSWD: ALL line I would like to not have ...
frumbert's user avatar
  • 263
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
3 votes
4 answers
11k 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
3 votes
2 answers
10k 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 ...
Scott's user avatar
  • 428
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
0 answers
461 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
-5 votes
1 answer
105 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