# Account Provisioning

Even though we have integrated authentication for accounts, user provisioning still needs to occur in every system independently.

## Unix accounts

We have a script called `create_user.sh` that provisions all necessary accounts. It takes the username. first name. and last name as the arguments.

It:

* Generates an LDIF
* Export the LDIF
* Adds the LDIF to openldap1
* Creates an AFS home directory
* and resets the Kerberos principal password to the default

### Manual Provisioning

{% hint style="warning" %}
Use of the manual steps is not recommended.
{% endhint %}

#### Creating AFS User

First, you need to create an AFS user account. Make sure you are authenticated with your /admin principal.

```
pts createuser <username>
```

The command should give an output similar to:

```
User <username> has id 12345678
```

If the user already has an AFS user account, run the following command in order to obtain an ID.

```
pts examine <username>
```

#### Creating LDAP User

Next, you need to add the account to LDAP. First, generate an LDIF file using the guide at [NSS LDAP Templates](https://github.com/tjcsl/gitbook/tree/0ed8086a38339b7cf231d8d987eae570d21ccd8f/technologies/aauthentication/nss-ldap/templates.md). Run the command below after you have created an LDIF file.

```
ldapadd -h openldap1 -Y GSSAPI -f <ldif file>
```

Below is an example LDIF file. Make sure you replace first name, last name, uidNumber, and graduation year!

```
dn: uid=2017ewang,ou=2017,ou=students,ou=people,dc=csl,dc=tjhsst,dc=edu
cn: Eric Wang
description: 2017
displayName: Wang, Eric
givenName: Eric
uid: 2017ewang
sn: Wang
objectClass: inetOrgPerson
objectClass: top
objectClass: organizationalPerson
objectClass: person
objectClass: posixAccount
uidNumber: 00000000
gecos: Eric Wang
gidNumber: 2017
homeDirectory: /afs/csl.tjhsst.edu/students/2017/2017ewang
loginShell: /bin/bash
```

#### Adding AFS Volume

```
cd /afs/csl.tjhsst.edu/.students/.20XX/
vos create -server openafs3 -partition vicepa -name 20XX.<username> -maxquota 1048576
vos backup 20XX.<username>
fs mkmount <username> 20XX.<username>
fs mkmount <username>/yesterday 20XX.<username>.<backup>
fs sa <username> <username> rlidwka
vos release students.20XX
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.tjhsst.edu/procedures/account-provisioning.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
