<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def connect(self):
 """Connect to host """

        try:
            self.client.connect(self.host, username=self.username,
                           password=self.password, port=self.port,
                           pkey=self.pkey, timeout=self.timeout)
        except sock_gaierror, ex:
            raise Exception("Unknown host '%s'" % self.host)
        except sock_error, ex:
            raise Exception("Error connecting to host '%s:%s'\n%s" % (self.host, self.port, ex))
        except paramiko.AuthenticationException, ex:
            msg = "Host is '%s:%s'"
            raise Exception("Authentication Error to host '%s'" % self.host)
        except paramiko.SSHException, ex:
            msg = "General SSH error - %s" % ex
            raise Exception(msg)