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

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

3 Answers 3

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
1  
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

 
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.