3

Whenever I su to user X, it always starts in user Y home directory. The biggest issue is that then X doesn't run its .bash_profile, it attempts Y's and fails. I'm guessing it's just a typo in how the user was defined, but don't know where that is. This is on Red Hat.

How do I change the user's starting directory or otherwise fix these symptoms?

5
  • 1
    are you doing su <user> or su <user> - ?
    – Zypher
    Dec 21, 2010 at 18:38
  • @Zypher I was just doing su X
    – Adam
    Dec 21, 2010 at 18:41
  • The option below leads me to believe the problem is that I logged in as user Y, and was in his home. Did some stuff from there and was looking to switch to user X with X's full profile. The -l flag provides the behavior I was expecting
    – Adam
    Dec 21, 2010 at 18:43
  • You should mark it answered, then ;) Dec 21, 2010 at 19:03
  • I had to wait 10 min. ;)
    – Adam
    Dec 21, 2010 at 19:43

1 Answer 1

3

Try su -l $userX to, "Provide an environment similar to what the user would expect had the user logged in directly."

You must log in to answer this question.

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