# Fix "no home directory" issue when first time logging in

**URL:** <https://discourse.openondemand.org/t/fix-no-home-directory-issue-when-first-time-logging-in/1091>\
**Category:** Get Help\
**Created:** [August 29, 2020, 4:04am UTC](https://discourse.openondemand.org/t/fix-no-home-directory-issue-when-first-time-logging-in/1091 "2020-08-29T04:04:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wpurwant](https://avatars.discourse-cdn.com/v4/letter/w/c2a13f/32.png) [@wpurwant](https://discourse.openondemand.org/u/wpurwant)\
**Post date:** [August 29, 2020, 4:04am UTC](https://discourse.openondemand.org/t/fix-no-home-directory-issue-when-first-time-logging-in/1091/1 "2020-08-29T04:04:08Z")

</div>

Hi, we try to ease user’s onboarding to HPC using OnDemand interface. On our site (with OOD 1.6 I think) we have a problem: if this is the very first time a new user logs on to our system, then the home directory has not yet been made in `/home/$USER` . Then the OOD login failed with error message “Missing home directory” or something like that. Right now we can work around this by ssh-ing first into the login node so that the home directory is created. Then login via OnDemand will work as usual.

My question is: has there been workaround so we can get the home directory created on the first login? Home directory creation is a privileged operation so I am not sure if this doable. Any suggestion would be appreeciated.

Wirawan

---

<div class="post-metadata">

**Author:** ![tdockendorf](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/tdockendorf/32/202_2.png) [@tdockendorf](https://discourse.openondemand.org/u/tdockendorf)\
**Post date:** [September 1, 2020, 11:35am UTC](https://discourse.openondemand.org/t/fix-no-home-directory-issue-when-first-time-logging-in/1091/2 "2020-09-01T11:35:30Z")

</div>

There have been several others with this issue which resulted in some changes and this documentation: [https://osc.github.io/ood-documentation/master/customization.html#custom-error-page-for-missing-home-directory-on-launch](https://osc.github.io/ood-documentation/master/customization.html#custom-error-page-for-missing-home-directory-on-launch)

A future release of OnDemand will include a `pre_run_hook` type config in nginx\_stage that would allow you to run a command before the PUN is launched so you could use that to bootstrap the home directory: [https://github.com/OSC/ondemand/pull/535](https://github.com/OSC/ondemand/pull/535)

---

<div class="post-metadata">

**Author:** ![westburg.2](https://avatars.discourse-cdn.com/v4/letter/w/0ea827/32.png) [@westburg.2](https://discourse.openondemand.org/u/westburg.2)\
**Post date:** [May 26, 2022, 3:43pm UTC](https://discourse.openondemand.org/t/fix-no-home-directory-issue-when-first-time-logging-in/1091/3 "2022-05-26T15:43:09Z")

</div>


