Configure Users With Rake Tasks

Rake tasks can be used to configure and manage IBM Aspera Shares users, groups, shares, and nodes from the command line. Rake tasks must be run from the Shares shell, as described in the following steps:
  1. Go to the shares folder:
    #cd /opt/aspera/shares/u/shares/bin
  2. Test that your rake tasks are working correctly.
    ./run rake -T

The following rake tasks create, modify and delete users, as well as export and import users from .csv files.

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 --first_name John --last_name Doe

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 --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:


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 [OPTIONS]
Note: Delimit distinguished names containing spaces with quotes (").
When running the create and update tasks, you can add the following options to your command to set values for the Shares user's fields:
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

Fetch User Details from LDAP

./run rake data:group:ldap:fetch -- --username username

For example:

./run rake data:group:ldap:fetch -- --username samldoe

Delete LDAP User

./run rake data:user:ldap:delete -- --username username

For example:

./run rake data:user:ldap:delete -- --username samldoe