LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   problem in running the command as a normal user (https://www.linuxquestions.org/questions/linux-general-1/problem-in-running-the-command-as-a-normal-user-336998/)

junaid18183 06-25-2005 03:48 AM

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.

junaid18183 06-25-2005 03:56 AM

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

trickykid 06-25-2005 06:27 AM

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


All times are GMT -5. The time now is 09:56 PM.