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.
as you can tell from my thread title, I am running CentOS as both server and a client machine for college, but I am restricted to using version 5.8 and it does not seem to have the right PATH for regular users to use commands like service, ifconfig,sendmail and commands of that sort. I have to resort to finding the full pathname for the command like /usr/sbin/sendmail in order to get it to work. However when i SU - , to login to root with full attributes, root has access to all those commands without the full path to it.
I am wondering if anyone knows to set the PATH to the proper PATH so I can use these commands and not have to login as root all the time?
as you can tell from my thread title, I am running CentOS as both server and a client machine for college, but I am restricted to using version 5.8 and it does not seem to have the right PATH for regular users to use commands like service, ifconfig,sendmail and commands of that sort. I have to resort to finding the full pathname for the command like /usr/sbin/sendmail in order to get it to work. However when i SU - , to login to root with full attributes, root has access to all those commands without the full path to it.
I am wondering if anyone knows to set the PATH to the proper PATH so I can use these commands and not have to login as root all the time?
Regular users don't use "service,sendmail and commands of that sort". service in particular is only usable by root. Sendmail is normally used as a daemon, not by users. Users use MUAs, and sendmail is a MTA. Now special case use of sendmail is possible - but only if the user knows how to format mail messages for a MTA. And that is what utilities like mail, mailx are used for.
All you need to do is look in roots profile. Might also check the /etc/profile in case it sets a different one when it is the root user logging in.
I am wondering if anyone knows to set the PATH to the proper PATH
It already has the "proper" PATH. The programs in /sbin and /usr/sbin are in those directories, and not in your PATH, because they are specifically NOT meant for regular users to run them. They are administrative programs that are meant to be run by root, not regular users.
You can add them to your PATH so that you don't have to use the full path to run them, but most of the things you try to do with those programs will result in "permission denied" errors anyway unless you're running them as root.
Last edited by suicidaleggroll; 03-29-2013 at 01:57 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.