Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 06-11-2007, 12:48 PM   #1
Registered: Feb 2004
Location: Chaska, MN
Distribution: Fedora
Posts: 195

Rep: Reputation: 31
Sudo Wildcard

Hi - I'm trying to create a sudo entry to allow the user "ropuser" to run the chfn far I have

ropuser ALL=(root)NOPASSWD:/usr/bin/chfn -f [!;]* [!;]*

I'm trying to use the wildcards to disallow the use of the ; character, running any command as root. bad. I'm new to this wildcard thing, and it doesn't work. Anyone know the syntax for this?


Scott K Logan
Old 06-11-2007, 06:32 PM   #2
LQ Guru
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 62
Not sure if the wildcard options are needed or whether sudo understands them. I kind of use a simply line like this.
ropuser ALL=NOPASSWD: /usr/bin/chfn

The use of ; seperate for addition commands. The way you have may be confusing even though in brackets.

Old 06-11-2007, 08:11 PM   #3
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
If a user included a semicolon, it will be included in the GEOS file and not execute the command after the semicolon.

You might want to use %u in the argument however to allow the user to change his own GEOS information but not that of other users. So the command is run a root, but can only be run to change the users own GEOS field. You might also use "-- %u" so that the user entry can't be hidden by making it an argument to another option.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: The Ultimate Sudo FAQ To Sudo Or Not To Sudo? LXer Syndicated Linux News 13 04-13-2013 02:36 AM
wildcard SSL - dedicated IP chack Linux - General 1 03-20-2007 11:48 PM
Using wildcard characters mlink4 Red Hat 1 01-26-2007 06:06 AM
Restricting Editing in Sudo (Advanced Sudo Question) LinuxGeek Linux - Software 4 11-04-2006 04:20 PM
I choose you wildcard! tearinox Linux - Newbie 2 01-23-2004 09:44 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:35 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration