LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-11-2007, 07:17 AM   #1
vbseeker
LQ Newbie
 
Registered: May 2005
Location: India
Posts: 13

Rep: Reputation: 1
ifconfig command access for sudo


Hi,

I am trying to implement the sudo on the server.
Currently what i did is as follow.

Made a group = operation
added a user to the group = abcd

in the sudo file i have made the following entry

abcd, %operation ALL= NOPASSWD: /sbin/, /usr/sbin/, /bin , /usr/bin

Now if i login to the server as a abcd user. Then i am using the following command to know the ipaddress of the machine.

sudo ifconfig

and i get the following out.

sudo: ifconfig: command not found

Pls let me know how to configure the sudo file so that the abcd user can use the ifconfig command.


Thanks

Anand
 
Old 01-11-2007, 07:37 AM   #2
Broder
Member
 
Registered: Oct 2006
Location: Santa Barbara, C.A.
Distribution: Mood dependent
Posts: 117

Rep: Reputation: 15
As root edit the sudoers file, There should be a line in it somewhere that says something like:

root ALL = (ALL) ALL

so add your user after this line:

abcd ALL = (ALL) ALL

You haven't mentioned your distro but on some distros I think you need to run /sbin/ifconfig as opposed to just ifconfig

Last edited by Broder; 03-13-2007 at 10:54 AM.
 
Old 01-11-2007, 12:26 PM   #3
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Quote:
Originally Posted by Feelda
As root edit the sudoers file, I'm not at my machine at the moment so can't tell you exactly but there should be a line in it somewhere that says something like:

root ALL = (ALL) ALL

so add your user after this line:

abcd ALL = (ALL) ALL
Be careful: this will give the user abcd FULL root access, to all commands.
 
Old 01-11-2007, 12:27 PM   #4
vbseeker
LQ Newbie
 
Registered: May 2005
Location: India
Posts: 13

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by Feelda
As root edit the sudoers file, I'm not at my machine at the moment so can't tell you exactly but there should be a line in it somewhere that says something like:

root ALL = (ALL) ALL

so add your user after this line:

abcd ALL = (ALL) ALL

You haven't mentioned your distro but on some distros I think you need to run /sbin/ifconfig as opposed to just ifconfig

It worked man. Thanks for the help.
 
1 members found this post helpful.
Old 01-12-2007, 04:37 AM   #5
Broder
Member
 
Registered: Oct 2006
Location: Santa Barbara, C.A.
Distribution: Mood dependent
Posts: 117

Rep: Reputation: 15
Yes, as Matir said, this gives full access. Would suggest reading up on sudoers file. Full access is not always wise as sometimes the hand can be faster than the head and thats when mistakes happen!
 
Old 08-12-2011, 01:23 AM   #6
mushtaque_asghar
LQ Newbie
 
Registered: Apr 2009
Location: Sukkur, Sindh
Distribution: Ubuntu 8.10
Posts: 5

Rep: Reputation: 0
Thumbs up Thanks ...

Quote:
Originally Posted by vbseeker View Post
It worked man. Thanks for the help.
Mushtaq: It works for me also at CentOS v5.5
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sudo command boy_to_man Linux - Newbie 1 01-05-2007 01:45 AM
connecting /sbin/ifconfig to bash command ifconfig flammable2 Fedora 4 11-12-2005 07:58 AM
SUDO Command help TPAWired Linux - Software 3 08-15-2005 01:50 PM
IFConfig command dvong3 Linux - Networking 5 01-07-2004 07:44 AM
ifconfig command shoot2kill Linux - Networking 10 10-22-2003 12:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:21 AM.

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