diff --git a/artiq/remoting.py b/artiq/remoting.py index 24e53b53a..41ca35928 100644 --- a/artiq/remoting.py +++ b/artiq/remoting.py @@ -59,7 +59,11 @@ class LocalClient(Client): class SSHClient(Client): def __init__(self, host, jump_host=None): - self.host = host + if "@" in host: + self.username, self.host = host.split("@") + else: + self.host = host + self.username = None self.jump_host = jump_host self.ssh = None self.sftp = None @@ -83,7 +87,7 @@ class SSHClient(Client): self.ssh = paramiko.SSHClient() self.ssh.load_system_host_keys() self.ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) - self.ssh.connect(self.host, sock=proxy) + self.ssh.connect(self.host, username=self.username, sock=proxy) logger.debug("Connecting to {}".format(self.host)) return self.ssh