Configuring Users With Rake Tasks
Use rake tasks to create, modify, and delete users; to import SAML and LDAP users; and to export users to and import users from .csv files.
Rake tasks must be run from the Shares shell, as described in the
following steps:
- Go to the shares folder:
# cd /opt/aspera/shares/u/shares/bin
- Test that your rake tasks are working correctly.
# ./run rake -T
Create User
# ./run rake data:user:create -- --username username --password password --email email_address --first_name first_name --last_name last_name
For example:
# ./run rake data:user:create -- --username johndoe --password ********* --email john@shares.example.com --first_name John --last_name Doe
By default, Shares requires a user to change their password when they first log in. You can disable that requirement by setting the --set_password option to true. For example:
# ./run rake data:user:create -- --username johndoe --password ********* --email john@shares.example.com --first_name John --last_name Doe --set_password true
Delete User
# ./run rake data:user:delete -- --username username
For example:
# ./run rake data:user:delete -- --username johndoe
Update User
# ./run rake data:user:update -- --username username --password password --email email --first_name first_name --last_name last_name
For example:
# ./run rake data:user:update -- --username johndoe --password ********* --email john@shares.example.com --first_name John --last_name Doe
Export a List of Users
# ./run rake data:user:export -- --path /path/to/file
For example:
# ./run rake data:user:export -- --path /temp/projectgroups.txt
The export command writes the groups into a .txt file. For example, the projectgroups.txt file may read like below:
projectgroup1
projectgroup2
Import Users (from .csv)
Note: The .csv file must use the following
format:
Username, Email, First Name, Last Name, Password
# ./run rake data:user:import -- --path /path/to/file
For example:
# ./run rake data:user:import -- --path /temp/users.csv
Important: By default, users created by this rake command are not allowed to log
into Shares. A Shares admin can set login permissions for these users one by one by going to
Admin > Users, selecting the user, clicking Edit
Security, and selecting the Login permission. Users for
whom no passwords are specified are assigned a random password and must click the
Forgot your username and password? link to reset their password and
log in.
Import SAML User
# ./run rake data:user:saml:import -- --id full_distinguished_name --name_id shares_username [--option option_value]
Note: Delimit
distinguished names containing spaces with quotes (").
Option | Description |
---|---|
--given_name given_name | This value determines the Shares user's first name. |
--surname surname | This value determines the Shares user's last name. |
--email email | This value determines the Shares user's email address. |
For example:
# ./run rake data:user:saml:import -- --id "CN=saml doe,OU=AK,OU=Users,OU=Asperasoft,DC=dev,DC=aspera,DC=us" --name_id samldoe --given_name Sam --surname Doe --email samldoe@shares.example.com
Delete SAML User
# ./run rake data:user:saml:delete -- --username username
For example:
# ./run rake data:user:saml:delete -- --username samldoe
Fetch User Details from LDAP
# ./run rake data:group:ldap:fetch -- --username username
For example:
# ./run rake data:group:ldap:fetch -- --username ldapdoe
Delete LDAP User
# ./run rake data:user:ldap:delete -- --username username
For example:
# ./run rake data:user:ldap:delete -- --username ldapdoe