# PAM Authentication for admin created user

**URL:** <https://discourse.jupyter.org/t/pam-authentication-for-admin-created-user/2180>\
**Category:** General\
**Created:** [September 19, 2019, 7:33am UTC](https://discourse.jupyter.org/t/pam-authentication-for-admin-created-user/2180 "2019-09-19T07:33:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pratik\_Bamb](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/pratik_bamb/32/775_2.png) [@Pratik\_Bamb](https://discourse.jupyter.org/u/Pratik_Bamb)\
**Post date:** [September 19, 2019, 7:33am UTC](https://discourse.jupyter.org/t/pam-authentication-for-admin-created-user/2180/1 "2019-09-19T07:33:09Z")

</div>

Password for newly created user,

Currently, I am using jupyterHub for multi-user. Where I am creating a new user using admin user in Jupyter Hub.

What is the password for the newly created user? Or is there is any way to create a password for admin created user?

---

<div class="post-metadata">

**Author:** ![vilhelmen](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/vilhelmen/32/1053_2.png) [@vilhelmen](https://discourse.jupyter.org/u/vilhelmen)\
**Post date:** [October 2, 2019, 9:09pm UTC](https://discourse.jupyter.org/t/pam-authentication-for-admin-created-user/2180/2 "2019-10-02T21:09:14Z")

</div>

Hi there, I did some digging in the code and it looks like, by default, the password for the account is disabled.

When a user is created, it runs whatever is in `c.LocalAuthenticator.add_user_cmd`, which on linux defaults to `['adduser', '-q', '--gecos', '""', '--disabled-password']` with the username added as the last argument (it will also replace any instance of `"USERNAME"` in the list with the username).

As this is being executed as a single process, you won’t be able to chain commands together to set a password unless you launch a script or a shell with a command (I wouldn’t suggest this due to complexity). There doesn’t seem to be a good way to set the password via `adducer`, so I would suggest using a script to create users.

Something like the following should set the account password to the reverse of the username

```auto
#!/usr/bin/env bash

adduser -q --gecos "" --disabled-password "${1}"

echo "${1}" | rev | passwd --stdin "${1}"

```

Save this script wherever you’d like (I usually use `/opt`) and set `c.LocalAuthenticator.add_user_cmd` to `['/path/to/script']` and it should work!
