LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 06-25-2005, 04:48 AM   #1
junaid18183
Member
 
Registered: Mar 2005
Location: India
Distribution: RedHat 9.0 and EL
Posts: 31

Rep: Reputation: 15
problem in running the command as a normal user


Hello Buddies,

This is very basic question thats make me a fool:

When I logged in as a root on my linuxbox and run the command
Quote:
ifconfig
it executes without any problem.


But when I looged in as a junaid it gives an error:

Quote:
bash: ifconfig: command not found
I thought that ifconfig is restricted command that only root can use.(I think I am right, am I ?)

Upto this is Cool

But when I looged in as a root and swith to juniad using
Quote:
su junaid
and runs the command
QUOTE]ifconfig[/QUOTE]
it executes without any problem.
How??

I also tried to give the full access to junaid in
Quote:
/etc/sudoers
file but while logging as junaid when I run
Quote:
sudo ifconfig
it gives me the same error.

Will you please explain the above problem.

Junaid.
 
Old 06-25-2005, 04:56 AM   #2
junaid18183
Member
 
Registered: Mar 2005
Location: India
Distribution: RedHat 9.0 and EL
Posts: 31

Original Poster
Rep: Reputation: 15
TO my surprice when I logged in as junaid and switches to root using su and runs the command ifconfig it still gives the error.

In short:

user ------->su------->result

root ------->--- ------->OK

root ------->junaid ------->OK


Junaid ------->--- ------->Failed

Junaid ------->root ------->Failed

thanx
 
Old 06-25-2005, 07:27 AM   #3
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Because you don't have /sbin in your path..

su -

or

su - root

will give you root's full complete path environment. a simple su won't.

And if you want to run this command by simply typing ifconfig for a regular user, add the /sbin directory to your $PATH
 
  


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
Running super user commands as normal user mickyg Linux - Security 5 10-14-2005 08:25 PM
can normal user use shutdown command? sorno Linux - Newbie 2 07-30-2005 07:11 AM
problem running stormpkg as normal user drrnsk8ter4 Linux - Software 0 04-24-2004 02:15 AM
normal user running shutdown cblamer Slackware 6 12-21-2003 09:44 PM
running ethereal as a normal user tangle Linux - Software 1 02-04-2003 10:35 PM


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