1

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.

2 Answers 2

4

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.

2

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .