'redis-cli Connection timed out

I have a Redis server machine and I can connect it successfully on my mac or a linux machine A with:

redis-cli -h xxxx -p xxx -a xxxxx

However, when I try to connect it with another Linux client machine B, it fails with

Could not connect to Redis at xxxx:xxx: Connection timed out

How can I diagnose with the client machine? It seems the problem is with linux machine B. But how can I diagnose with it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source