def connect(self, sshhost = None, user = None, pwd = None, port = None):
"""
Connects this instance with the instance sshhost over SSH.
username -- the user and pwd is the password.
Port -- the port number to connect to.
See SSHClient.connect for more information on optional parameters
that can be set when using the underlying layer instead of this one.
"""
if sshhost is None:
sshhost = self.sshhost
if user is None:
user = self.username
if pwd is None:
pwd = self.pwd
if port is not None:
self.client.connect(sshhost, username = user, password = pwd, port=port)
else:
self.client.connect(sshhost, username = user, password = pwd)
评论列表
文章目录