The protdir utility is used to manage password protection of Web directories on domains through CLI. By using this utility, you can perform the following tasks:
Syntax
protdir <command> [<directory name>] [
<option_1> [<param>]
[<option_2> [<param>]]
…[<option_N> [<param>]]
]
Example
The following command line creates password-protected directory Protected_Dir in the /httpdocs directory on domain example.com, adds the password-protected directory user authorizeduser, and sets the user password to userpass.
# ./protdir --create Protected_Dir -domain example.com -add_user authorizeduser -passwd userpass
Commands
Command |
Parameter |
Description |
Example |
|---|---|---|---|
|
|
Creates a password protected directory on a domain. If the directory already exist on the domain, the command enables password protection of the directory. Requires concomitant use of the |
To create password-protected directory Protected_Dir in the /httpdocs directory on domain example.com: # ./protdir --create Protected_Dir -domain example.com -type nonssl or # ./protdir -c Protected_Dir -domain example.com -type nonssl |
|
|
Updates settings of a password-protected directory. |
To set title "This directory is password protected" for the login dialog box to be displayed when users attempt to access password-protected directory /httpdocs/Protected_Dir: # ./protdir --update Protected_Dir -domain example.com -title "This directory is password protected" or # ./protdir -u Protected_Dir -domain example.com -title "This directory is password protected" |
|
|
Deletes a password-protected directory. |
To delete password-protected directory /httpdocs/Protected_Dir from domain example.com: # ./protdir --remove Protected_Dir -domain example.com -type nonssl or # ./protdir -r Protected_Dir -domain example.com -type nonssl |
|
|
Displays help on the use of the utility. |
To see help on the use of the protdir utility: # ./protdir -–help or # ./protdir -h |
Options
Option |
Parameter |
Description |
Example |
|---|---|---|---|
|
|
Specifies the name of a domain to which a password-protected directory belongs. Used with all commands, except the |
To create the Protected_Sample protected URL on example.com: # ./protdir -c Protected_Dir -domain example.com |
|
|
Specifies the title for the login dialog box to be displayed when users attempt to access a password-protected directory. |
To set title # ./protdir -u Protected_Dir -domain example.com -title "This directory is password protected" |
|
|
Specifies the location of a password directory in the domain root catalog:
|
To create password-protected directory # ./protdir -c Protected/Protected_Dir -domain example.com -type nonssl |
|
|
Specifies the password for accessing contents of a password-protected directory by a user. See additional comments in the Note below the table. |
To create user authorizeduser authorized to access contents of password-protected directory # ./protdir -u Protected_Dir -type nonssl -domain example.com -add_user authorizeduser -passwd userpass -passwd_type plain |
|
|
Specifies the type of the password for accessing contents of a password-protected directory by users. See additional comments in the Note below the table. |
|
|
|
Creates a password-protected directory user with the specified login name. |
|
|
|
Updates settings of a password-protected directory user with the specified login name. |
To change the user login name from # ./protdir -u Protected_Dir -type nonssl -domain example.com -update_user authorizeduser -user_name admin |
|
|
Sets a password-protected directory login name. Used in conjunction with the |
|
|
|
Deletes a password-protected directory user with the specified login name. |
To delete the user with login name authorizeduser for a password-protected directory # ./protdir -u Protected_Dir -type nonssl -domain example.com -remove_user authorizeduser |
|
|
Sets a new name for a password-protected directory. Used in conjunction with the |
To set a new name # ./protdir -u Protected_Dir -type nonssl -domain example.com -dir_name Protected_Archive |
Note: Use of this option is not recommended. Passing passwords through CLI as parameters of the -passwd option may potentially compromise the system's security as command line can be observed by other users of the system. It is more secure to pass passwords through the environment variables. You can transfer non-encrypted passwords by using environment variable PSA_PASSWORD while using single quotes to specify the empty values in the command line for the argument of the -passwd - -passwd_type options.
Similarly, you can transfer encrypted passwords through the environment variable PSA_CRYPTED_PASSWORD while using single quotes to specify the empty values in the command line for the argument of the -passwd and -passwd_type options.