npsxutil command-line tool

Download npsxutil (0.99 MB).


The npsxutil command-line tool is intended primarily for system administrators and advanced users who need to automate the deployment and management of NetDetour settings.

Using npsxutil together with the accompanying documentation, you can:

  • Create and modify XML-based NetDetour Proxifying Settings (.npsx) files without using the graphical user interface.
  • Generate .npsx files programmatically from scripts or deployment tools.
  • Encrypt passwords and authentication keys stored in .npsx files.
  • Apply NetDetour settings from the command line.
  • Convert OpenSSH keys into formats suitable for use in .npsx files.

Command Syntax

npsxutil

Available commands:

ApplySettings  [passphrase]

EncryptPasswords   [output npsx file]

FormatSSHKey 

FormatSSHHostKey 

ApplySettings

ApplySettings [passphrase]

Applies NetDetour settings from the specified .npsx file.

If passwords and authentication keys in the file are encrypted, specify the passphrase on the command line or enter it when prompted.

Examples:

npsxutil ApplySettings config.npsx

npsxutil ApplySettings config.npsx MyPassphrase

Tip

Applying settings may require administrative privileges. By default, only members of the local Administrators group are allowed to modify the NetDetour configuration. If this restriction is enabled, run npsxutil from an elevated command prompt when using the ApplySettings command. The setting can be changed in NetDetour › Tools › Options.

EncryptPasswords

EncryptPasswords [output npsx file]

Encrypts all passwords and authentication keys contained in a .npsx file using the specified passphrase.

If an output file is specified, the encrypted configuration is written to that file. Otherwise, the input file is modified in place.

Examples:

npsxutil EncryptPasswords config.npsx SecretPassphrase

npsxutil EncryptPasswords config.npsx.xml SecretPassphrase config.npsx

After encryption, the resulting file can be distributed without exposing proxy passwords and authentication keys, including SSH private keys.

FormatSSHKey

FormatSSHKey

Converts an OpenSSH private key into a Base64-encoded value suitable for use in the key attribute of a proxy definition within a .npsx file.

If the OpenSSH private key file is encrypted, you will be prompted to enter its passphrase.

Example:

npsxutil FormatSSHKey id_rsa

The command outputs the converted value to standard output.

FormatSSHHostKey

FormatSSHHostKey

Converts an OpenSSH public host key into a Base64-encoded value suitable for use in the hostKey attribute of a proxy definition within a .npsx file.

Example:

npsxutil FormatSSHHostKey ssh_host_rsa_key.pub

The command outputs the converted value to standard output.


Return Codes

On success, npsxutil returns:

0

and produces no output, except for the FormatSSHKey and FormatSSHHostKey commands, which output the generated Base64-encoded value.

On failure, npsxutil reports an error to standard error (stderr) and returns:

1

If required parameters are missing, the tool displays the command syntax help and returns 1.


Included Documentation and Samples

The following files are included with npsxutil:

File Description
npsx-format.html Complete NPSX file format reference.
sample.npsx.xml Minimal sample configuration file.

Download npsxutil (0.99 MB).

Was this article helpful?