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?
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?
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 ofsu
. There's no way to directly configuresu
to limit it's use per user, whilesudo
gives you a lot of control over users, groups, and specific commands.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.