Special characters issue in password

We are currently trying to resolve the duplicate issue-Mqtt

Recently I launched the hive-MQ setup- everything is fine.

but the problem is with the password of my user.

I have created two new users and passwords, one user password with a special character, and a second user password without a special character.

there is no problem with the second user(without special characters)

am not able to log in with the first user(with a special character)

please help out me with this issue.

Hi @mounika ,

It is great to see your interest in MQTT and HiveMQ broker, welcome to the community!

In order to help you please share which version of HiveMQ broker you use, which extension you use for client authentication, and your configs. Please make it clear which exact special character you use.

We will try to help you

Kind regards,
Dasha from HiveMQ team

Thanks for your response.

HiveMQ version 4.9.1

special character like ,+!@{}$%

My config file.

cat config.xml

<?xml version="1.0"?> 18756 0.0.0.0 true 8000 0.0.0.0 /mqtt mqttv3.1 mqtt false true
<cluster>
    <enabled>false</enabled>
</cluster>

<anonymous-usage-statistics>
    <enabled>true</enabled>
</anonymous-usage-statistics>

<control-center>
    <enabled>true</enabled>
    <listeners>
        <http>
            <port>8080</port>
            <bind-address>0.0.0.0</bind-address>
        </http>
</listeners>
<users>
        <user>
            <name>testuser</name>
            <password>e5b4881ea9c84501b7a50e03a3hgvhjkfbd1be138ad84a8fdd62f2c776ac526d</password>
        </user>
    </users>
</control-center>
<client-event-history>
            <enabled>true</enabled>
            <lifetime>86400</lifetime> <!-- 7 days -->
</client-event-history>

Hi @Daria_H

Am waiting for your response.

@mounika ,

Please specify the exact command that you used to generate the hash sum for the password present in the config.xml that you have shared.
Please specify in which OS (Windows, Linux, MacOS) and shell (bash, zsh, sh, cmd, PowerShell) the command has been executed.

Thank you,
Dasha from HiveMQ team

@Daria_H

LINUX:
echo -n userpassword | sha256sum
shell- CMD

@mounika ,

You indicated that you have an issue with a special character in your password. What was that special character and what was the exact command that you used?
You know that some special characters are also treated as special characters by the shell, so it is important how you escape those characters in the userpassword string and which quotation marks you use.

CMD shell in Linux is rather unusual. Perhaps you are using The Windows Subsystem for Linux (WSL)? Please add a screenshot with your command and its output.

@Daria_H

Please find the snap below.

and I tried with another password-
vWd4FL8123@11
vWd4,mQ+'m7;{FL8

@Daria_H
Can you please let me know what are the special characters are not allowed in password of hive-mq in shall CMD.

@mounika ,

Thanks for sharing your examples. So, if you want to add users:

  • mounika with password vWd4,mQ+'m7;{FL8
  • eva with password vWd4FL8123@11
  • jarek with password 8DF394857-GLKDJF48736-HFKJ3845673
  • robo with password pa$$word

First, Generate SHA256 Password:

#echo -n "mounikavWd4,mQ+'m7;{FL8" | shasum -a 256
5d4ec5e4ef68abf70717d0cba39f0aef3937e6d7ba963ae7e5e64411b3d4f650  -

#echo -n "evavWd4FL8123@11" | shasum -a 256
9f754c4c931bfba53d34265c9e5a5699729086b8051679c90feb0d823d8550e3  -

#echo -n "jarek8DF394857-GLKDJF48736-HFKJ3845673" | shasum -a 256
8c06beff1e094a678acb8865d54f745a634a229e9c5de0680936e775c2cbbec6  -

#echo -n "robopa\$\$word" | shasum -a 256
34b1c53070902b4d9cab862991427af67b80295ba3415114ef20293acf345a77  -

Second, configure users in the config.xml accordingly:

<?xml version="1.0"?>
<hivemq>

    <listeners>
        <tcp-listener>
            <port>1883</port>
            <bind-address>0.0.0.0</bind-address>
        </tcp-listener>
    </listeners>

    <anonymous-usage-statistics>
        <enabled>true</enabled>
    </anonymous-usage-statistics>

   <control-center>
        <enabled>true</enabled>
        <users>
            <user>
                <name>mounika</name>
                <password>5d4ec5e4ef68abf70717d0cba39f0aef3937e6d7ba963ae7e5e64411b3d4f650</password>
            </user>
            <user>
                <name>eva</name>
                <password>9f754c4c931bfba53d34265c9e5a5699729086b8051679c90feb0d823d8550e3</password>
            </user>
            <user>
                <name>jarek</name>
                <password>8c06beff1e094a678acb8865d54f745a634a229e9c5de0680936e775c2cbbec6</password>
            </user>
            <user>
                <name>robo</name>
                <password>34b1c53070902b4d9cab862991427af67b80295ba3415114ef20293acf345a77</password>
            </user>
        </users>
    </control-center>
</hivemq>

Third, start your HiveMQ broker. Go to https://localhost:8080 and log in with new users and passwords.

I hope this helps.

Regards,
Dasha from HiveMQ Team

Take a look here: Special Characters and Quoting - Learning the bash Shell, Second Edition [Book]