LinuxQuestions.org
Visit Jeremy's Blog.
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 02-13-2006, 10:50 AM   #1
sunpascal
Member
 
Registered: Jan 2005
Distribution: Debian
Posts: 104

Rep: Reputation: 15
ifconfig as normal user / without su


hi,
how do I configure ifconfig to run as normal user without having to do su?
Is it enough to change the permissions with chmod?

-sunpascal
 
Old 02-13-2006, 11:03 AM   #2
duffmckagan
Senior Member
 
Registered: Feb 2005
Distribution: Cent OS 6.4
Posts: 1,163

Rep: Reputation: 48
ifconfig is under /sbin.

Can't run without root priveleges.
 
Old 02-13-2006, 11:06 AM   #3
sunpascal
Member
 
Registered: Jan 2005
Distribution: Debian
Posts: 104

Original Poster
Rep: Reputation: 15
sorry, I don't get that.
Does that mean ALL files under /sbin are root-only?
Is it possible to copy ifconfig and put it somewhere else?

-sunpascal
 
Old 02-13-2006, 11:15 AM   #4
ethics
Senior Member
 
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522

Rep: Reputation: 45
man sudo

allows users to execute some/all root commands with their own pass (or none at all for convienience).

You could chmod i spose but i wouldn't go around lowering permissions for essential system things, bad habbit
 
Old 02-13-2006, 11:47 AM   #5
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,117

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
Most (all?) commands under /sbin are executable by anybody, but many can't be used to their full potential UNLESS you are root. e.g., a normal user can certainly run /sbin/ifconfig and get a display describing the current setup. But I doubt a normal user could invoke ifconfig to bring an interface down (I haven't tried this as a normal user, but I'll bet it won't work!)

Other commands, /sbin/iptables --list for example, are certainly executable by anyone, but they error out unless you are root.

There are reasons why root is the only user allowed to run certain commands. I wouldn't go mucking with that setup if I were you. Use sudo or su ... that's the correct way to do this.
 
Old 02-13-2006, 12:18 PM   #6
duffmckagan
Senior Member
 
Registered: Feb 2005
Distribution: Cent OS 6.4
Posts: 1,163

Rep: Reputation: 48
>Is it possible to copy ifconfig and put it somewhere else?


Hehe..that is funny.

ifconfig is a command that comes under the /sbin directory. You can say s-bin stands for system-bin...meaning this folder has special commands which are critical for the "system". Commands in /bin can be run by all, but not the ones in /sbin.
 
Old 02-13-2006, 02:52 PM   #7
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 271Reputation: 271Reputation: 271
You can add /sbin to your path and should then be able to run it as root.

Like everyone says though, it will be limited since you're not root.
 
Old 03-19-2006, 11:34 PM   #8
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 59
you could edit your /etc/sudoers file so that the normal user could execute the command.. check this page
 
Old 03-20-2006, 01:51 AM   #9
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 49
Anyone can always run /sbin/ifconfig and almost all other programs in /sbin. They can always run ifconfig to display the status of any/all interfaces; but the system won't allow non-root users activate/deactivate or change settings for interfaces. This has nothing to do with the /sbin/ifconfig program itself.
 
Old 03-20-2006, 02:03 AM   #10
sunpascal
Member
 
Registered: Jan 2005
Distribution: Debian
Posts: 104

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by pljvaldez
You can add /sbin to your path and should then be
how do I edit my path?
 
Old 03-20-2006, 07:43 AM   #11
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by sunpascal
how do I edit my path?
To see what is in your path:
echo $PATH
To add to it:
export PATH="$PATH:<newpathname>"

eg, to add /sbin (which should already BE there, BTW):
export PATH="$PATH:/sbin"

to make this permanent, you have to put something in the init config files. I don't have that part at my fingertips

Last edited by pixellany; 03-20-2006 at 07:49 AM.
 
  


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
Running super user commands as normal user mickyg Linux - Security 5 10-14-2005 08:25 PM
how to run ifconfig as root without super user terminal GUIPenguin Linux - General 1 01-15-2005 11:06 AM
can't use iwconfig, iwlist, ifconfig as user marlor Slackware 6 10-18-2004 05:27 PM
Games runs slow as normal user, but fast as root user mcore Linux - Software 2 06-08-2004 12:11 AM
normal user = super user jayakrishnan Linux - General 4 03-19-2002 10:58 AM


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