1828371 Members
3137 Online
109976 Solutions
New Discussion

sudo syntax

 
SOLVED
Go to solution
Rainer von Bongartz
Honored Contributor

sudo syntax

I'm trying to configure sudo to allow a user to mount and umount an NFS share.

I've put the following in the sudoers file but always get an syntax error on the Cmnd_alias line:

Cmnd_Alias MNT =/usr/sbin/mount nova:/INFORMIXTMP/backup /INFORMIXTMP/backup

informix ALL = NOPASSWD: MNT

Cann anybode help on the correct syntax ?

Regards
Rainer

He's a real UNIX Man, sitting in his UNIX LAN making all his UNIX plans for nobody ...
3 REPLIES 3
R.O.
Esteemed Contributor

Re: sudo syntax

# Cmnd alias specification
Cmnd_Alias MNT = /usr/sbin/mount


after this, try to execute the command:

sudo mount nova:/INFORMIXTMP/backup/INFORMIXTMP/backup

Regards,
"When you look into an abyss, the abyss also looks into you"
Ermin Borovac
Honored Contributor
Solution

Re: sudo syntax

Colon (:) is special character for sudo and it must be escaped with backslash (\).

Cmnd_Alias MNT =/usr/sbin/mount nova\:/INFORMIXTMP/backup /INFORMIXTMP/backup
Rainer von Bongartz
Honored Contributor

Re: sudo syntax

Thanks Ermin...
He's a real UNIX Man, sitting in his UNIX LAN making all his UNIX plans for nobody ...