LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 11-04-2007, 06:54 AM   #1
akhil.mud
LQ Newbie
 
Registered: Sep 2007
Posts: 17

Rep: Reputation: 0
SUDO's syntax


can some one tell me the exact syntax of using the sudo command
i am able to use the sudo commands on the /bin folder but on the /sbin folder
 
Old 11-04-2007, 07:14 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Look at file /etc/sudoers. Commands in /sbin may not be included in sudoers. You can edit the file to add the /sbin commands a user needs.
 
Old 11-04-2007, 07:29 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Or maybe /sbin is not in your $PATH. On some distros, just using su to take on root powers does not give access to things in /sbin---You have to use "su -" to get root's environment. I don't know how sudo operates in this regard, but you can try:
sudo /sbin/command
 
Old 11-04-2007, 10:24 AM   #4
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
Go with pixellany, You will need to use the full path to commands under /sbin when using sudo.
sudo /sbin/ifconfig

Brian
 
Old 11-05-2007, 07:54 AM   #5
akhil.mud
LQ Newbie
 
Registered: Sep 2007
Posts: 17

Original Poster
Rep: Reputation: 0
thanxs for your rplies,can some one tell me an example of editing /etc/sudoer file,by showing a command which is not allowed to user .plz

Last edited by akhil.mud; 11-05-2007 at 08:03 AM.
 
Old 11-05-2007, 08:40 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by akhil.mud View Post
showing a command which is not allowed to user
If it's not in the sudoers entry for that user, that user is not allowed to execute the command. Easy isn't it? Besides the sudo man page is littered with examples. Best read the man page, then set up an example and then your sudoers file if you fail.
 
  


Reply



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
Syntax: %0*lx-- what does it mean?? ashlesha Programming 1 08-14-2006 02:53 PM
C syntax ashlesha Programming 6 07-04-2006 07:53 PM
Help with lp syntax slick_willie Programming 2 02-03-2005 07:18 PM
C++ syntax error before :: token HELP, i cant find the syntax error :( qwijibow Programming 2 12-14-2004 06:09 PM
syntax lynger Linux - Software 6 12-02-2003 01:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:04 PM.

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