Skip to main content

We've Moved!

Product Documentation has moved to docs.hitachivantara.com
Hitachi Vantara Knowledge

Managing users

How to manage users for Content Software for File using the CLI.

Creating users using the CLI

Commandweka user add

Use the following command line to create a user:

weka user add <username> <role> [password] [--posix-uid uid] [--posix-gid gid]
Parameters
NameTypeValueLimitationsMandatoryDefault
usernameStringName of the user to change the password forMust be a valid local userYes
roleStringRole of the new created userregular, readonly, orgadmin or clusteradminYes
passwordStringNew passwordNoIf not supplied, command will prompt to supply the password
posix-uidNumberPOSIX UID of underlying files representing objects created by this S3 user access/keys credentialsFor S3 user roles onlyNo0
posix-gidNumberPOSIX GID of underlying files representing objects created by this S3 user access/keys credentialsFor S3 user roles onlyNo0
For example,
$ weka user add my_new_user regular S3cret

This command line creates a user with a username of my_new_user, a password of S3cret and a role of Regular user. It is then possible to display a list of users and verify that the user was created:

1 $ weka user
2 Username    | Source   | Role
3 ------------+----------+--------
4 my_new_user | Internal | Regular
5 admin       | Internal | Admin

Using the weka user whoami command, it is possible to receive information about the current user running the command.

To use the new user credentials, use the WEKA_USERNAME and WEKA_PASSWORD environment variables:

$ WEKA_USERNAME=my_new_user WEKA_PASSWORD=S3cret 1 weka user whoami
2 Username    | Source   | Role
3 ------------+----------+--------
4 my_new_user | Internal | Regular

Changing user passwords using the CLI

Commandweka user passwd

Use the following command line to change a local user password:

weka user passwd <password> [--username username]
Parameters
NameTypeValueLimitationsMandatoryDefault
passwordStringNew passwordYes
usernameStringName of the user to change the password forMust be a valid local userNoCurrent logged-in user
NoteIf necessary, provide or set WEKA_USERNAME or WEKA_PASSWORD.

Revoking user access using the CLI

Command:

weka user revoke-tokens

Use the following command to revoke internal user access to the system and mounting filesystems:

weka user revoke-tokens <username>

You can revoke the access for LDAP users by changing the user-revocation-attribute defined in the LDAP server configuration.

Parameters:
NameTypeValueLimitationsMandatoryDefault
usernameString/IntegerA valid user in the organization of the Organization Admin running the commandYes
NoteNFS and SMB are different protocols from WekaFS, which require additional security considerations when used. For example, The system grants NFS permissions per host. Therefore, manage the permissions for accessing these hosts for NFS export carefully.

Updating a local user using the CLI

Command:

weka user update

Use the following command line to update a local user:

weka user update <username> [--role role] [--posix-uid uid] [--posix-gid gid]
Parameters:
NameTypeValueLimitationsMandatoryDefault
usernameStringName of an existing userMust be a valid local userYes
roleStringUpdated user roleregular, s3,readonly, orgadmin or clusteradminNo
posix-uidNumberPOSIX UID of underlying files representing objects created by this S3 user access/keys credentialsFor S3 user roles onlyNo
posix-gidNumberPOSIX GID of underlying files representing objects created by this S3 user access/keys credentialsFor S3 user roles onlyNo

Deleting users using the CLI

Commandweka user delete

To delete a user, use the following command line:

weka user delete <username>
Parameters
NameTypeValueLimitationsMandatoryDefault
usernameStringName of the user to delete.Must be a valid local user.Yes
For example:
$ weka user add my_new_user

Then run the weka user command to verify that the user was deleted:

1 $ weka user
2 Username | Source | Role
3 ---------+----------+------
4 admin | Internal | Admin

User sign in

When a login is attempted, the user is first searched in the list of internal users, i.e., users created using theweka user add command.

However, if a user does not exist in the Content Software for File system but does exist in an LDAP directory, it is possible to configure the LDAP user directory to the Content Software for File system. This will enable a search for the user in the directory, followed by password verification.

On each successful login, a UserLoggedIn event is issued, containing the username, role and whether the user is an internal or LDAP user.

When a login fails, an "Invalid username or password" message is displayed and a UserLoginFailed event is issued, containing the username and the reason for the login failure.

When users open the GUI, they are prompted to provide their username and password. To pass username and password to the CLI, use the WEKA_USERNAME and WEKA_PASSWORD environment variables.

Alternatively, it is possible to log into the CLI as a specific user using the weka user login <username> <password>command. This will run each CLI command from that user. When a user logs in, a token file is created to be used for authentication (default to ~/.weka/auth-token.json, which can be changed using the --path attribute). To see the logged-in CLI user, run theweka user whoami command.

NoteThe weka user login command is persistent, but only applies to the host on which it was set.
Note If theWEKA_USERNAME/WEKA_PASSWORD environment variables are not specified, the CLI uses the default token file. If no CLI user is explicitly logged-in, and no token file is present the CLI uses the default admin/admin.

To use a non-default path for the token file, use the WEKA_TOKEN environment variable

Authenticating users from an LDAP user directory using the CLI

To authenticate users from an LDAP user directory, the LDAP directory must first be configured to theContent Software for File system. This is performed as follows.

Configuring an LDAP server using the CLI

Command

weka user ldap setup

weka user ldap setup-ad

One of two CLI commands is used to configure an LDAP user directory for user authentication. The first is for configuring a general LDAP server and the second is for configuring an Active Directory server.

To configure an LDAP server, use the following command line:

weka user ldap setup <server-uri> <base-dn> <user-object-class> <user-id-attribute> <group-object-class> <group-membership-attribute> <group-id-attribute> <reader-username> <reader-password> <cluster-admin-group> <org-admin-group> <regular-group> <readonly-group> [--start-tls start-tls] [--ignore-start-tls-failure ignore-start-tls-failure] [--server-timeout-secs server-timeout-secs] [--protocol-version protocol-version] [--user-revocation-attribute user-revocation-attribute]

To configure an Active Directory server, use the following command line:

weka user ldap setup-ad <server-uri> <domain> <reader-username> <reader-password> <cluster-admin-group> <org-admin-group> <regular-group> <readonly-group> [--start-tls start-tls] [--ignore-start-tls-failure ignore-start-tls-failure] [--server-timeout-secs server-timeout-secs] [--user-revocation-attribute user-revocation-attribute]
Parameters
NameTypeValueLimitationsMandatoryDefault
server-uriStringEither the LDAP server host name/IP or a URIURI must be in format ldap://hostname:port or ldaps://hostname:portYes
base-dnStringBase DN under which users are storedMust be valid nameYes
user-id-attributeStringAttribute storing user IDsMust be valid nameYes
user-object-classStringObject class of usersMust be valid nameYes
group-object-classStringObject class of groupsMust be valid nameYes
group-membership-attributeStringAttribute of group containing the DN of a user membership in the groupMust be valid nameYes
group-id-attributeStringAttribute storing the group nameName has to match names used in the <admin-group>, <regular group> and <readonly group>Yes
reader-username and reader-passwordStringCredentials of a user with read access to the directoryPassword is kept in the Content Software for File cluster configuration in plain text, as it is used to authenticate against the directory during user authenticationYes
cluster-admin-groupStringName of group containing users defined with cluster admin roleMust be valid nameYes
org-admin-groupStringName of group containing users defined with organization admin roleMust be valid nameYes
regular-groupStringName of group containing users defined with regular privilegesMust be valid nameYes
readonly-groupStringName of group containing users defined with read only privilegesMust be valid nameYes
server-timeout-secsNumberServer connection timeoutSecondsNo
protocol-versionStringSelection of LDAP versionLDAP v2 or v3NoLDAP v3
user-revocation-attributeStringThe LDAP attribute; when its value changes in the LDAP directory, user access and mount tokens are revokedUser must re-login after a change is detectedNo
start-tlsStringIssue StartTLS after connectingyes or noNoNo
ignore-start-tls-failureStringIgnore start TLS failureyes or noNoNo

Viewing a configured LDAP user directory using the CLI

Commandweka user ldap

This command is used for viewing the current LDAP configuration used for authenticating users.

Disabling or enabling a configured LDAP user directory using the CLI

Command

weka user ldap disable

weka user ldap enable

These commands are used for disabling or enabling user authentication through a configured LDAP user directory.

NoteYou can only disable an LDAP configuration, but not delete it.