LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-21-2004, 02:25 PM   #1
LinuxRam
Member
 
Registered: Jul 2004
Distribution: Red Hat 9, Mandrake 9.2
Posts: 211

Rep: Reputation: 30
ifconfig


only super user can do "ifconfig"

but when a normal user executes /sbin/ifconfig then also it executes

why is it so ??
 
Old 08-21-2004, 02:40 PM   #2
SBing
Member
 
Registered: Mar 2004
Posts: 519

Rep: Reputation: 35
If a user types in:

$ ifconfig
($ being the prompt for a user)

Then ifconfig will not run, UNLESS, /sbin is in the user's path.

$ echo $PATH

Will output what the user's paths are, e.g.:

/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/usr/lib/java/bin:/usr/lib/java/jre/bin:/usr/lib/qt/bin:.

As you can see, my path variable does not contain /sbin so when I type in 'ifconfig', the terminal will not look in /sbin



If root types in:

# echo $PATH
(# being the prompt for a root user)

You may get: /usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin

As you can see, /sbin is there, so when 'ifconfig' is typed in, the terminal will look in /sbin



By typing in: /sbin/ifconfig

You are giving a full path, so the terminal does not have a search for the file, it simply executes the program you have given it.

Hope that's clear,

Steve
 
Old 08-21-2004, 05:14 PM   #3
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,276

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
A normal user can look at interface info with ifconfig (I do it all the time -- it's kinda handy not to have to become root just to look up my network settings), but can't change them. If you try to actually change anything as a normal user, you'll get a permission denied message.
 
Old 08-28-2004, 11:15 PM   #4
LinuxRam
Member
 
Registered: Jul 2004
Distribution: Red Hat 9, Mandrake 9.2
Posts: 211

Original Poster
Rep: Reputation: 30
thanks btmiller and SBing
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
connecting /sbin/ifconfig to bash command ifconfig flammable2 Fedora 4 11-12-2005 08:58 AM
Ifconfig mrodriguez Linux - Newbie 2 02-16-2005 01:17 PM
Oh where or where has ifconfig gone thotFree Linux - Software 3 11-13-2003 01:27 AM
Ifconfig ! mesta Linux - Software 2 02-04-2003 10:18 AM
ifconfig Astro Slackware 6 01-08-2003 05:30 PM


All times are GMT -5. The time now is 04:54 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration