Code: Select all
GNU nano 5.4 /etc/sudoers.tmp
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification (added by peer)
Cmnd_Alias FOTOOS = /bin/mount -t nfs 192.168.178.5\:/volume1/fotoos, /bin/umount 192.168.178.5\:/volume1/fotoos
Cmnd_Alias DATA = /bin/mount -t nfs 192.168.178.5\:/volume1/data, /bin/umount 192.168.178.5\:/volume1/data
# User privilege specification (second line added by peer)
root ALL=(ALL:ALL) ALL
peer ALL=(ALL) NOPASSWD: FOTOOS, DATA
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "@include" directives:
@includedir /etc/sudoers.d
I added two Cmnd_Aliasses and one user privilege.
In the Aliasses I used the full path of the commands and I used an escape key for the special character ':'.
When I save the file visudo does not complain.
I looked at several howto's but I cannot see what I am doing wrong. Can somebody help me?
edit:
I moved the user privilege line to the bottom of the file: no change
Then I changed the line to
Code: Select all
peer ALL=(ALL) NOPASSWD: ALL