From e96e4fa25ab2a5734abcaa0a44b9105843e0efd4 Mon Sep 17 00:00:00 2001 From: Salim B Date: Thu, 7 Nov 2024 01:10:02 +0100 Subject: [PATCH] Tweak script description --- scripts/experimental/batch_user_creation.sh | 43 ++++++++++++--------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/scripts/experimental/batch_user_creation.sh b/scripts/experimental/batch_user_creation.sh index 4f2ed7ca..d499cad3 100755 --- a/scripts/experimental/batch_user_creation.sh +++ b/scripts/experimental/batch_user_creation.sh @@ -1,23 +1,30 @@ #!/bin/bash -# Batch creation of user accounts in RStudio Server. The script reads a list -# of username and password pairs from the `BATCH_USER_CREATION` environment -# variable and uses this information to update a group of existing users when -# the container starts. Each pair is of the format `username:password` and is -# separated from the next by a semicolon, with no intervening whitespace. -# Usernames may only be up to 32 characters long (required by `useradd`) and -# by default the supplied passwords must be in clear-text (later encrypted by -# `chpasswd`). If a username already exists, the script will deny that -# particular account creation request; otherwise, the user account will be -# created, the login shell set to Bash and the user's home directory created -# unless it already exists. By default, a group will be created for each new -# user with the same name as her username. If the groupname already exists, -# the script will deny the group creation request. If the password is not -# specified, it is assumed to be equal to the username. All users will also be -# added to the `staff` group (same as the default `rstudio` user). A directory -# called `.rstudio/monitored/user-settings/user-settings` is created in that -# user's home directory to store RStudio initial preferences. Users are not -# allowed to read other users' home directory. +# Batch creation of user accounts in RStudio Server +# +# This script reads a list of username and password pairs from the +# `BATCH_USER_CREATION` environment variable and uses this information to create +# or update user accounts when the container starts. +# +# Each pair is of the format `username:password` and is separated from the next +# one by a semicolon, with no intervening whitespace. Usernames may only be up +# to 32 characters long (required by `useradd`). By default, the supplied +# passwords must be in clear-text (later encrypted by `chpasswd`). If the +# password is not specified, it is assumed to be equal to the username. +# +# If a username already exists, the script will skip that particular account +# creation; otherwise, the user account will be created, the login shell set to +# Bash and the user's home directory created unless it already exists. +# +# By default, a group will be created for each new user with the same name as +# their username. If the groupname already exists, the script will skip the +# group creation. All users will also be added to the `staff` group (same as the +# default `rstudio` user). +# +# Finally, a directory called `.rstudio/monitored/user-settings/user-settings` +# is created in the user's home directory to store initial RStudio preferences. +# +# Users are not allowed to read other users' home directories. set -e