Adding users or changing password

To setup new credentials for a user or adding a new user follow these steps:

  • Step 1. Dump the current content of the htpasswd ‘users.txt’ file.

    # Make sure to connect to kfuse cluster. rm users.txt # ignore this if there's no such file currently. kubectl get secret -n kfuse kfuse-auth-users -o json | jq -r '.data."users.txt"' | base64 -d > users.txt
  • Step 2. If changing the password of a user, then remove existing entry for that user from users.txt file. Otherwise go to step 3.

  • Step 3. Ensure that the users.txt ends with a new line.

    echo "" >> users.txt
  • Step 4. create or change password for the user (following example uses testuser as the user. For admin user use admin ):

    htpasswd -Bn testuser >> users.txt
    • Note: Make sure that that each user is listed in a separate line in the users.txt file.

  • Step 5. create a base64 encoding of the content of users.txt

  • Step 6. create a kubernetes secret called kfuse-auth-users (or update the existing one). Use the output of cat users.txt| base64 as the value of users.txt entry in the secret as shown below. Use the following command if you are editing the existing secret.

  • Step 5. Skip to Step 6 if adding new user or updating password for existing user. Otherwise, update your custom values.yaml to point to kfuse-auth-users secret as below:

  • Step 6. restart kfuse-auth deployment.

Related pages