jsecret, jtool secret

You can use the jsecret command-line tool to create a connection file. This tool can also be used to generate a shared secret. Shared secrets are used by Platform Agents to make sure they are connected to the correct Process Server.

Note: For installation instructions, see jtool.

Connection Files

A connection file is an encrypted file that acts like a password to RunMyJobs. It contains all the necessary information to connect to the central RunMyJobs server, including the username, password, hostname, and port. Connection files can be used by command-line system tools such as jevent.

Generating a Connection File

To generate a connection file, use this syntax.

Copy
jsecret -c [-proxy <url>] [-auth <method>] <filename> <url>

Argument Description
-c Creates a connection file.
<filename> The name of the file.
-proxy <url> The proxy server to use.
-auth <method> The authentication method to use for the proxy server. <method> can be either basic (default), or none if the proxy server requires no authentication.
<url> The URL of the target system, using the format http[s]://<hostname>:<port>/<context>. For example: https://pr1.example.com:10180/redwood.

Proxy Setting Environment Variables

The following environment variables are used to retrieve proxy server connection details.

  • HTTP_PROXY: The URL of the proxy server. For example: https://proxy.example.com:3128.
  • PROXY_USER: The user for the proxy server. This value is ignored if HTTP_PROXY is not set.
  • PROXY_PASSWORD: The password for the proxy user. This value is ignored if HTTP_PROXY is not set.
  • NO_PROXY: Enforces a direct connection.

These environment variables override the settings in the connection file for all tools that connect to the central Redwood server.

Generating a Shared Secret File

To generate a shared secret file, use a command like this.

Copy
jsecret -n <filename>

Argument Description Default
-n Creates a shared secret.

<filename> The path of the file. net/instance/<instance_name>/private/secret

Generating a proxy_url_password Secret File

To generate a proxy_url_password secret file, use a command like this.

Copy
jsecret -p <filename>

Argument Description Default
-p Creates a file containing the password to the proxy server, as defined in the proxy_url configuration file. Copy the output file of this command to proxy_url_password and store it in the private directory for your Platform Agent instance.

<filename> The path of the file. <install_directory>/net/instance/<instance_name>/private/proxy_url_password

Generating MD5 Checksums

To generate an MD5 checksum for a file, use a command like this.

Copy
jsecret -md5 <filename>

Argument Description
-md5 Creates an md5 checksum of the specified file.
<filename> The name of the file.

Generating SHA1 Checksums

To generate an SHA1 checksum for a file, use a command like this.

Copy
jsecret -sha1 <filename>

Argument Description
-sha1 Creates a SHA1 checksum of the specified file.
<filename> The name of the file.

Generating SHA256 Checksums

To generate an SHA256 checksum for a file, use a command like this.

Copy
jsecret -sha256 <filename>

Argument Description
-sha256 Creates an SHA256 checksum of the specified file.
<filename> The name of the file.

Examples

Generating a Connection File for Raising Events

Copy
$ jsecret -c ./example.conn https://pr1.example.com:50000/redwood
Username:admin
Password:*****
$ ls -l ./example.conn
-rw------- 1 redwood users 240 nov 18 15:16 ./example.conn

Generating a Connection File for jftp

Copy
$ jsecret -c ./ftp.sec ftp://ftp.example.com:21
Username:admin
Password:*****
$ ls -l ./ftp.sec
-rw------- 1 redwood users 240 nov 18 15:17 ./ftp.sec

Generating a Connection File in a Process

Copy
(jecho "username"&&jecho "password") | jsecret -c ./ftp.sec ftp://ftp.example.com:21

Generating a Shared Secret File

Copy
jsecret -n net/instance/<instance>/private/secret

Generating a proxy_url_password File

Copy
jsecret -p net/instance/<instance>/private/proxy_url_password

Note: The proxy_url and proxy_url_password files can contain more than one URL/password in a comma-separated list. For more information, see Configuring Platform Agents.