No, it does not necessarily mean that you should be wary of others. This expression is generally used to encourage caution and to protect oneself against the risks presented by an unknown or dangerous environment.