# Password generator(Postgres and MySQL)

Please watch video <https://www.youtube.com/watch?v=ZDD_DjkbVcQ>   or follow below instructions

You can use this feature to generate random passwords - Next time when you create a new postgres role try this feature to generate complex password

Please select option 6 followed by option 2 as illustrated below

<figure><img src="https://3013412235-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fj94nGPKUS9dlzKveRYHc%2Fuploads%2FNybDJubY0JNDoqaohnDF%2Fimage.png?alt=media&#x26;token=a3abb9bd-ed92-4a09-b86a-6bb6dbd47db3" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3013412235-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fj94nGPKUS9dlzKveRYHc%2Fuploads%2F78h1Rb5Qg71hWmZAdyKm%2Fimage.png?alt=media&#x26;token=352bf2eb-2136-4cb5-a4c1-07d1b9284665" alt=""><figcaption></figcaption></figure>

You need to select length , special chars etc.. or leave the defaults - Default is length of 20 , 2 digits , 2 special chars , 2 uppercase chars

<figure><img src="https://3013412235-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fj94nGPKUS9dlzKveRYHc%2Fuploads%2FiX4huHJYjunnSZH71Ges%2Fimage.png?alt=media&#x26;token=469dcbfd-8fe3-4be0-b4e5-27dba7bd804c" alt="" width="375"><figcaption></figcaption></figure>

It produces plaintext password and encrypted password (scram-sha-256 format)

<figure><img src="https://3013412235-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fj94nGPKUS9dlzKveRYHc%2Fuploads%2FTOVO2pJDgfA0Op6YrqL1%2Fimage.png?alt=media&#x26;token=41be4f74-bfa5-46ef-8f8c-5d2b38d156d1" alt=""><figcaption></figcaption></figure>

<mark style="color:red;">**NOTE : When creating a new user in Postgres, please use encrypted passwords only. This will prevent password leakage in logs**</mark>

Example (Please see below screenshot)

<figure><img src="https://3013412235-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fj94nGPKUS9dlzKveRYHc%2Fuploads%2FcV2cFYQJmlkcMyEATBah%2Fimage.png?alt=media&#x26;token=9dd462c5-112e-47b4-93cb-521dcd66998c" alt=""><figcaption></figcaption></figure>

You can also set custom profiles in config file to use the same pattern repeatedly&#x20;

Add below section to your config file located at /etc/klouddbshield/kshieldconfig.toml

```
[generatePassword]
length=9
numberCount=1
numUppercase=2
specialCharCount=5
```
