![]() |
High Performance OPC UA Server SDK
1.7.1.383
|
The tool uapasswd
is a command line program which can be used to manage passwords for user authentication. People who know the UNIX passwd
command or SAMBA's smbpasswd
command should feel familiar.
This tool also serves as an example on how to manage the SDK's passwd
file when using the "internal" authentication backend. See also authentication for more information.
The source code of uapasswd
can be found in src/tools/uapasswd
.
Like all good command line tools it has a built-in help which can be used to find out about the available options.
The SDK provides example files for users, groups and passwords to use with the DemoServer and ServerExamples. When making a product do not use these files but create your own.
The passwords are stored in the file unreadable as hashes with salt, however it is still possible to start brute-force attacks against these hashes to retrieve the passwords. Therefore the password file should only be readable by the server process and no other user.
By default it will load the same settings.conf
file as used by all our example servers. If you want to use a different configuration file you can do so using the option -c
.
To create or update a user's password invoke the command as shown in this example.
The tool will prompt you for the new password twice as usual to avoid typing mistakes. It also performs password checks to ensure that secure passwords are chosen.
By default passwords must contain
When built with BUILD_WITH_CRACKLIB=on
it will perform additional checks using cracklib to make the password robust against dictionary attacks. See https://github.com/cracklib/cracklib for more information on cracklib.
You can change these settings in src/tools/uapasswd/config.h
.
The passwd
file format allows to use different algorithms to be extendable and backwards-compatible. At the time of writing a salted SHA256 or SHA512 hash is used which is then converted to a HEX string to be stored in the plain text file.
It also supports cleartext passwords, but this is mainly useful for testing and should not be used in production. For this reason the default algorithm, if not specified, is SHA256.
To remove an entry from the file use the following command.
By adding the option -r
the tool will create a fresh file. All existing entries will be lost.