Validate host name on connection

Ensure that hostname does not contain invalid characters on login.