Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
most people set /sbin and /usr/sbin in PATH for root
this could be in /etc/profile or /root/.bash_profile
Code:
if [ $EUID -eq 0 ] ; then
PATH=/sbin:/usr/sbin:$PATH
fi
if someone is cleaver enough to become root user then they already know stuff is in /sbin /usr/sbin
i don't think hiding those directories will help alot
but you can always just write aliases to the command with the fullpath you know in /root/.bashrc
Code:
if [ `whoami` = "root" ]; then
alias ifconfig='/sbin/ifconfig'
fi
Last edited by foo_bar_foo; 08-20-2005 at 11:24 PM.
There's absolutely nothing unsafe about adding directories to your user's $PATH. You can't do anything damaging to the system with the commands therein unless you are root. I find it most convenient to add /sbin to my nonprivilidged user's $PATH.
Just comment out the lines that begin with "if" and "fi", it should then look like the above. This will make it so that every user will be able to run the commands they have permissions for without typing the absolute path.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.