Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm in the process of migrating to key's for authentication on my CentOS boxes. I have it all set up and working, but was a bit taken aback when I noticed service (and other things) didn't work the way I was accustomed to. Even after su'ing to root, still had to call the full path for it to work (which I assume to be expected/normal behavior).

I also assume this is because there are different $PATH's for root (what I was using and am used to) and the newly created, key-using user. Specifically, I noticed the sbin's of the world missing from the user path.

If I were to add those paths (/sbin/,/usr/sbin/,/usr/local/sbin) to a profile.d .sh script for this new key-loving user, would:

  1. I be opening up the system in ways I shouldn't be?
  2. I be doing something I needn't do save for reasons of laziness?
  3. I create other potential problems?

Thanks.

share|improve this question

2 Answers 2

up vote 4 down vote accepted

Changing your path as a normal user to include the sbin directories is reasonable and standard practice. There is no substantial problem it will cause.

Most people do this on a per-user basis using the .profile or .*rc files, since you might not want less privileged users to see all the extra sysadmin focused binaries - but there is no great harm that will come from it. Without root all they will find out is that they don't have the right permissions to run the commands.

share|improve this answer

s stands for system in sbin directories. it is appropriate to add these to users who are system administrator, but for normal users it may not be a good idea, as most if not all these command would require root privileges.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.