Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I added a user for the sole purpose of using SU for root. I did not allow the creation of a home directory when creating the user. So now when I login as this user I get the following:

Could not chdir to home directory /home/MYUSERNAME: No such file or directory
Couldn't resolve homedir for current user at - line 0
BEGIN failed--compilation aborted.
Couldn't resolve homedir for current user at - line 0
BEGIN failed--compilation aborted.

Is this an error, and if so how do I fix it so it is not looking to "resolve" the homedir?

share|improve this question

When you login it will always try to resolve your home folder.
You could set the home directory of the user to a directory that does exist (in /etc/passwd) like /tmp.

But I would recommend simply creating the home for it.

Why not have it in the first place?

share|improve this answer

It looks like you have a perl script that tries to run at user login. This isn't anything standard, so look in the global profiles and rc scripts to see what may have been added.

Also, you should use sudo instead of su. There's no way to directly configure su to limit it's use per user, while sudo gives you a lot of control over users, groups, and specific commands.

share|improve this answer
You can restrict usage of su (/etc/pam.d/su), at least limit to group wheel, not sure about specific user/group right now. – faker Jun 17 '11 at 15:12
@faker - of course, wasn't thinking about pam, just config options. – JimB Jun 17 '11 at 15:19

You probably have perl-homedir installed. If you don't need it and are not going to create any home directory for this particular user, just uninstall the package.

yum remove perl-homedir 
share|improve this answer

Your Answer


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.