setting my path
Hello,
I am running Red Hat 8.0. When I run ifconfig as a user, I cannot see what the IP address is of my box. However, when I switch to being a root user (su -) and run ifconfig, I can see the IP address. How do I set my $PATH so I can run ifconfig as a regular user? Or is this possible?
Here is the user path:
-bash: /usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/azapata/bin
Root path:
-bash:
/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin/X11:/u sr/X11R6/bin:/root/bin
Let me know if I am missing any useful information.
Thanks.
Anna Zapata
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
I assume that when you run the command you are getting a "ifconfig: command not found" error.
Easiest thing to do would be to do a
whereis ifconfig
Typically this command is placed in th /sbin directory. Since you said that you can su to root then I assume you can make sure that your user account has the appropriate permissions to execute this command. If not then you get set them.
Regards,
Weston
Quoted 21 lines · Anna G. Zapata
Hello,
I am running Red Hat 8.0. When I run ifconfig as a user, I cannot see what the IP address is of my box. However, when I switch to being a root user (su -) and run ifconfig, I can see the IP address. How do I set my $PATH so I can run ifconfig as a regular user? Or is this possible?
Here is the user path:
-bash: /usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/azapata/bin
Root path:
-bash:
/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin/X11:/ u sr/X11R6/bin:/root/binLet me know if I am missing any useful information.
Thanks.
Quoted 7 lines
Anna Zapata
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Quoted 11 lines · Anna G. Zapata
Hello,
I am running Red Hat 8.0. When I run ifconfig as a user, I cannot see what the IP address is of my box. However, when I switch to being a root user (su -) and run ifconfig, I can see the IP address. How do I set my $PATH so I can run ifconfig as a regular user? Or is this possible?
Here is the user path:
-bash: /usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/azapata/bin
Quoted 7 lines
Root path:
-bash:
/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin/X11:/u sr/X11R6/bin:/root/binLet me know if I am missing any useful information.
When you say "cannot see", I assume you mean you get a response like this one:
autovcr@kuryakin:~$ ifconfig
-bash: ifconfig: command not found(If I've misinterpreted your question, the rest of this response is irrelevant and you need to ask your question again, explaining what "cannot see" means.)
Normally, ifconfig is in /sbin, which is in root's PATH but not non-root users' default PATH. The easiest solution is simply to run the command as:
autovcr@kuryakin:~$ /sbin/ifconfig
which will cause it to execute just fine.
Second option: add a symlink in (probably) /bin to ifconfig, so the normal default PATH for non-root users will execute ifconfig via the symlink.
Third option: add /sbin to non-root PATHs. How you do that depends a bit on where RH8.0 gets its PATH info from, something I don't know offhand. Probably you need to edit the PATH line in /etc/profile &/or the one for non-root users in /etc/login.defs .
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Quoted 6 lines · Anna G. Zapata
Hello,
I am running Red Hat 8.0. When I run ifconfig as a user, I cannot see what the IP address is of my box. However, when I switch to being a root user (su -) and run ifconfig, I can see the IP address. How do I set my $PATH so I can run ifconfig as a regular user? Or is this possible?
The main reason for a user not having access to programs like ifconfig is basicly a user has no need to use programs a admin would normally use so those programs are not in a users path, however i am sure if you type; /usr/sbin/ifconfig as a user {Note the full path is given on the command line} then it shuld produce the desired results.
Quoted 9 lines
Here is the user path:
-bash: /usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/azapata/bin
Root path:
-bash:
/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin/X11:/ u sr/X11R6/bin:/root/bin
Yes thats basicly as it should be, /usr/sbin and /sbin are System spesific and normally speaking are for the system operator.
There is nothig stopping you adding /sbin and /usr/sbin to a users path, however it is not a nix done thing as per the above mentioned reason. I am sure others will point out other reasons as well.
Quoted 2 lines
Let me know if I am missing any useful information.
No i think is more a need to understand that there is a "root" user and a "normal" user on all linux systems.
root = the superuser and therefor can do what he wants.
user = a normal user and cant do what he wants, he can only do what "root" lets him/her do.
Quoted 5 lines
Thanks.
Anna Zapata
Signature · 15 lines
If the Linux community is a bunch of theives because they try to imitate windows programs, then the Windows community is built on organized crime. Regards Richard [email protected] http://people.zeelandnet.nl/pa3gcu/ - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs
Anyway, in RedHat the ifconfig is in /sbin/ifconfig
If you want a certain user to have access to ifconfig, you should give the right permissions and then add to the .bashrc or .bash_profile the line:
alias ifconfig="/sbin/ifconfig" and then log out and in again (so that the RC file will be run again. You can also run another shell /bin/sh. But logging out and back in is better.
----- Original Message -----
From: "pa3gcu" <[email protected]>
To: "Anna G. Zapata" <[email protected]>; "Linux-Newbie" <[email protected]>
Sent: Monday, September 08, 2003 3:17 PM
Subject: Re: setting my path
Quoted 4 lines · Anna G. Zapata
Quoted 3 lines
Hello,
I am running Red Hat 8.0. When I run ifconfig as a user, I cannot see
what
Quoted 1 line
Quoted 1 line
the IP address is of my box. However, when I switch to being a root
user
Quoted 1 line
Quoted 1 line
(su -) and run ifconfig, I can see the IP address. How do I set my
$PATH
Quoted 6 lines
Quoted 1 line
so I can run ifconfig as a regular user? Or is this possible?
The main reason for a user not having access to programs like ifconfig is basicly a user has no need to use programs a admin would normally use so those programs are not in a users path, however i am sure if you type;
/usr/sbin/ifconfigas a user {Note the full path is given on the command
line}
Quoted 10 lines
then it shuld produce the desired results.
Quoted 8 lines
Here is the user path:
-bash: /usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/azapata/bin
Root path:
-bash:
/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin/X11:/
Quoted 3 lines
Quoted 1 line
u sr/X11R6/bin:/root/bin
Yes thats basicly as it should be,
/usr/sbinand /sbin are System spesific
and
Quoted 33 lines
normally speaking are for the system operator.
There is nothig stopping you adding /sbin and
/usr/sbinto a users path, however it is not a nix done thing as per the above mentioned reason. I am sure others will point out other reasons as well.Quoted 2 lines
Let me know if I am missing any useful information.
No i think is more a need to understand that there is a "root" user and a "normal" user on all linux systems.
root = the superuser and therefor can do what he wants.
user = a normal user and cant do what he wants, he can only do what "root" lets him/her do.Quoted 5 lines
Thanks.
Anna Zapata
--
If the Linux community is a bunch of theives because they try to imitate windows programs, then the Windows community is built on organized crime.Regards Richard
[email protected]
http://people.zeelandnet.nl/pa3gcu/
Quoted 5 lines
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Quoted 1 line · Alan Bort
Anyway, in RedHat the ifconfig is in
/sbin/ifconfig
Ah!, yes how correct you are, my mistake.
Quoted 5 lines
If you want a certain user to have access to ifconfig, you should give the right permissions and then add to the .bashrc or .bash_profile the line:
alias ifconfig="/sbin/ifconfig" and then log out and in again (so that the RC file will be run again. You can also run another shell/bin/sh. But logging out and back in is better.
HuH!!
1) No not at all, there is no need to give a user permissions to use ifconfig as he HAS permission to use it as is, what a normall user cannot do with ifconfig is up or down interfaces, a normal user can only see the details of ifconfig output, but giving a normall user permission to use ifconfig in its entirity you WILL comprimise your system to hackers, in otherwords you open a closed door for them period.
2) A normall user can do the alias him/herself by using the following; alias ifconfig='/sbin/ifconfig'
Thats it..
Signature · 15 lines
If the Linux community is a bunch of theives because they try to imitate windows programs, then the Windows community is built on organized crime. Regards Richard [email protected] http://people.zeelandnet.nl/pa3gcu/ - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs
Quoted 7 lines
No i think is more a need to understand that there is a "root" user and a "normal" user on all linux systems.
root = the superuser and therefor can do what he wants.
user = a normal user and cant do what he wants, he can only do what "root" lets him/her do.
Yes and they have different path statements too.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs