There are times when your home directory might not be available. This can be due to your homedir coming from LDAP or another network service and the local directory not being available. When logging in you’ll see something similar to
Last login: Mon Sep 13 21:03:37 from foo.example.com Could no chdir to home
There are several ways to work around this. Creating
one, but you might not want this to be permanent.
export HOME=`mktemp -d`
Will create a temporary directory and make that $HOME. This doesn’t resolve all issues with a missing home directory, but it’s a start.