we have an EC2 MongoDB 2.4 instance from Amazon MarketPlace. when i try to access it from my computer using the mongo command like so:
mongo xx-xx-xx-xx-xx.c
EC2 controls access using security group, so make sure that box accessing mongo db host is in the security group allowed to access this box and port is enabled for the same security group.
Another problem can be iptables. Check sudo service iptables status on the mongodb box and see what are the rules there.
Make sure there you enable appropriate ports as per security requirement of the box.