How to use Mosquito to achieve publish and subscribe between two virtual machines based on Linux system,

Here’s my mosquitto.conf file

listener 1883
allow_anonymous false
password_file /mosquitto-2.0.15/pwfile.example

Both VMS are registered with the same user root and the same password

VM1 mosquitto startup

Local test normally
When published on VM2
Error:Connection refused