# Setup Jupyterhub setup with NativeAuthenticator

**URL:** <https://discourse.jupyter.org/t/setup-jupyterhub-setup-with-nativeauthenticator/3652>\
**Category:** General\
**Created:** [March 16, 2020, 9:25pm UTC](https://discourse.jupyter.org/t/setup-jupyterhub-setup-with-nativeauthenticator/3652 "2020-03-16T21:25:44Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![sudi007](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@sudi007](https://discourse.jupyter.org/u/sudi007)\
**Post date:** [March 16, 2020, 9:25pm UTC](https://discourse.jupyter.org/t/setup-jupyterhub-setup-with-nativeauthenticator/3652/1 "2020-03-16T21:25:44Z")

</div>

Hello All  
i am setting up jupyterhub server for the firts time and need some help am having couple of issues i am trying to setup jupyterhub server on redhat linux with NativeAuthenticator in the jupyterconfig.py file but when i run the jupyterhub it allows me to create a username and password but when i try to log in it does not log in and even when i try to log in with root user , the other thing is am not able to access the admin page to authorize the user can anybody please guide me on how would i go about fixing the issue  
Thanks  
sudi

---

<div class="post-metadata">

**Author:** ![GeorgianaElena](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/georgianaelena/32/229_2.png) [@GeorgianaElena](https://discourse.jupyter.org/u/GeorgianaElena)\
**Post date:** [March 18, 2020, 9:50am UTC](https://discourse.jupyter.org/t/setup-jupyterhub-setup-with-nativeauthenticator/3652/2 "2020-03-18T09:50:38Z")

</div>

Hey @sudi007!

When you’re adding a new user through the signup page (`/hub/signup`), that user will be able to login only after it was authorized by an admin.

If you’re using NativeAuthenticator for the first time and don’t have any admin configured, you’ll have to:

- Add the admin user to the JupyterHub admin list. In `jupyterhub_config.py` add:  
`c.NativeAuthenticator.admin_users = {'<your-admin-user'>}`
- Register that admin with NativeAuthenticator through the signup page (go to `/hub/signup` and add `<your-admin-user>` and set a password for it)
- Login as `<your-admin-user>` using the credentials you just set.

Now that you’re logged in as an admin user, from the admin panel you’ll be able to authorize any user added trough the signup page.

(Linked GitHub issues: [https://github.com/jupyterhub/jupyterhub/issues/2988](https://github.com/jupyterhub/jupyterhub/issues/2988) and [https://github.com/jupyterhub/nativeauthenticator/issues/104](https://github.com/jupyterhub/nativeauthenticator/issues/104))

---

<div class="post-metadata">

**Author:** ![sudi007](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@sudi007](https://discourse.jupyter.org/u/sudi007)\
**Post date:** [March 18, 2020, 3:50pm UTC](https://discourse.jupyter.org/t/setup-jupyterhub-setup-with-nativeauthenticator/3652/3 "2020-03-18T15:50:09Z")

</div>

Hello Georgiana Elena

Thanks for the insight was able to get that resolved the issue but am still having an issue with when i authorize the user and login with that user name i get and error

# 500 : Internal Server Error

Error in Authenticator.pre\_spawn\_start: KeyError “getpwnam(): name not found: ‘admin’”

You can try restarting your server from the [home page](http://10.29.19.69:8000/hub/home).doing research i found that user that was created does not have access though the user is authorize so how do i go about giving them access without making them admin

---

<div class="post-metadata">

**Author:** ![GeorgianaElena](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/georgianaelena/32/229_2.png) [@GeorgianaElena](https://discourse.jupyter.org/u/GeorgianaElena)\
**Post date:** [March 18, 2020, 7:22pm UTC](https://discourse.jupyter.org/t/setup-jupyterhub-setup-with-nativeauthenticator/3652/4 "2020-03-18T19:22:00Z")

</div>

To give access to a user, navigate to `/hub/authorize` (from an admin account) and press the _Authorize_ button for that user (checkout [the docs](https://native-authenticator.readthedocs.io/en/latest/quickstart.html#authorize-or-unauthorize-users)).

When you hit that _Authorize_ button, you are not making the user an admin, you’re just giving them access to login to JupyterHub.

---

<div class="post-metadata">

**Author:** ![sudi007](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@sudi007](https://discourse.jupyter.org/u/sudi007)\
**Post date:** [March 18, 2020, 7:29pm UTC](https://discourse.jupyter.org/t/setup-jupyterhub-setup-with-nativeauthenticator/3652/5 "2020-03-18T19:29:44Z")

</div>

so when i authorize the user and log inwith that user account i get the following error

# 500 : Internal Server Error

Error in Authenticator.pre\_spawn\_start: KeyError “getpwnam(): name not found: ‘admin’”

You can try restarting your server from the [home page](http://10.29.19.69:8000/hub/home)

---

<div class="post-metadata">

**Author:** ![Nenoo](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/nenoo/32/1754_2.png) [@Nenoo](https://discourse.jupyter.org/u/Nenoo)\
**Post date:** [March 20, 2020, 3:06pm UTC](https://discourse.jupyter.org/t/setup-jupyterhub-setup-with-nativeauthenticator/3652/6 "2020-03-20T15:06:00Z")

</div>

Hi there, I am - as we speak - experiencing the same problem. Have you found, by any chance, a solution yet?

---

<div class="post-metadata">

**Author:** ![sudi007](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@sudi007](https://discourse.jupyter.org/u/sudi007)\
**Post date:** [March 20, 2020, 4:59pm UTC](https://discourse.jupyter.org/t/setup-jupyterhub-setup-with-nativeauthenticator/3652/7 "2020-03-20T16:59:13Z")

</div>

@Nenoo i am still experiencing the same problem have not found any solution yet,am still searching for the solution

Thanks

---

<div class="post-metadata">

**Author:** ![GeorgianaElena](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/georgianaelena/32/229_2.png) [@GeorgianaElena](https://discourse.jupyter.org/u/GeorgianaElena)\
**Post date:** [March 31, 2020, 9:04am UTC](https://discourse.jupyter.org/t/setup-jupyterhub-setup-with-nativeauthenticator/3652/8 "2020-03-31T09:04:49Z")

</div>

@sudi007, if you’re using the default JupyterHub spawner ([LocalProcessSpawner](https://jupyterhub.readthedocs.io/en/stable/api/spawner.html#jupyterhub.spawner.LocalProcessSpawner)), then you have to make sure that for each authenticated user, there is also a matching local UNIX user.  
(The `useradd` command can be used to create the `admin` user on your system.)

---

<div class="post-metadata">

**Author:** ![sudi007](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@sudi007](https://discourse.jupyter.org/u/sudi007)\
**Post date:** [March 31, 2020, 1:37pm UTC](https://discourse.jupyter.org/t/setup-jupyterhub-setup-with-nativeauthenticator/3652/9 "2020-03-31T13:37:39Z")

</div>

Yes am using local spwaner but i dont users to be admin for the machine when i add them is there any simple i can add users without being admin so they get access to resources

Thanks

Sudesh

---

<div class="post-metadata">

**Author:** ![Payam\_Chychi](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/payam_chychi/32/2445_2.png) [@Payam\_Chychi](https://discourse.jupyter.org/u/Payam_Chychi)\
**Post date:** [July 23, 2020, 5:22am UTC](https://discourse.jupyter.org/t/setup-jupyterhub-setup-with-nativeauthenticator/3652/10 "2020-07-23T05:22:02Z")

</div>

> [@GeorgianaElena](#):
>
> /hub/signup

Anyone figure this out? I’m also having the same issue. I can whitelist the user as the admin and get to the admin page but I still cant generate a server, i get 500 error. Thanks

---

<div class="post-metadata">

**Author:** ![lambdaTotoro](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/lambdatotoro/32/5544_2.png) [@lambdaTotoro](https://discourse.jupyter.org/u/lambdaTotoro)\
**Post date:** [October 21, 2021, 9:23pm UTC](https://discourse.jupyter.org/t/setup-jupyterhub-setup-with-nativeauthenticator/3652/11 "2021-10-21T21:23:52Z")

</div>

I realise it’s been a while since the last post in this topic, but it pops up in searches and I wanted to leave a resolution here for future travellers.

I maintain the NativeAuthenticator and this 500 error is a pretty popular one. In all instances known to me it was always a problem with the machine that was running JupyterHub not having an account for the account in question. They don’t need to be admins on the machine, but they need an account (with a home directory for their files and such).

You can either add them all manually or add a snippet to the configuration file that automatically creates them when they log in (linked at the end of [this entry](https://native-authenticator.readthedocs.io/en/latest/options.html#allow-self-serve-approval)).

---

<div class="post-metadata">

**Author:** ![tenwho](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/tenwho/32/10365_2.png) [@tenwho](https://discourse.jupyter.org/u/tenwho)\
**Post date:** [January 8, 2022, 6:25am UTC](https://discourse.jupyter.org/t/setup-jupyterhub-setup-with-nativeauthenticator/3652/12 "2022-01-08T06:25:49Z")

</div>

Hi, I’d like to share my case for reference. I created a user on Linux(RHEL) with a username that contains capital letters. Then, I signed up on `/hub/signup` using the same username and authorized it on `/hub/authorize`. However, JupyterHub automatically normalized the registered username so that all letters were lowercase (this is probably the default behavior of JupyterHub’s feature). Because of this, the Linux username and the JupyterHub username did not match, causing the 500 error.

In my environment, there is no problem in limiting all Linux usernames to lower case. Therefore, I took care of it that way.

---

<div class="post-metadata">

**Author:** ![pritster5](https://avatars.discourse-cdn.com/v4/letter/p/4da419/32.png) [@pritster5](https://discourse.jupyter.org/u/pritster5)\
**Post date:** [April 24, 2023, 9:40pm UTC](https://discourse.jupyter.org/t/setup-jupyterhub-setup-with-nativeauthenticator/3652/13 "2023-04-24T21:40:59Z")

</div>

How would one setup similar behavior if using a 3rd party authenticator like KeyCloak via the `c.JupyterHub.authenticator_class = GenericOAuthenticator`?

I’m able to get JupyterHub to redirect to KeyCloak, then users login in there, and are then redirected back to the JupyterHub page, but cannot start their own server because they don’t have their own user.

I’m currently using `c.JupyterHub.spawner_class = 'jupyterhub.spawner.SimpleLocalProcessSpawner' ` and this fails to start a server (which is expected, because as I understand, this spawner requires a local user account that matches the authenticated user).
