From a0df39ad28afa9cb69da8f702c79caff925f71bb Mon Sep 17 00:00:00 2001 From: feng <1304903146@qq.com> Date: Wed, 30 Nov 2022 20:38:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9connection=20token=20?= =?UTF-8?q?=E5=AF=B9=E6=8E=A5client=E7=9A=84username?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/terminal/const.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/terminal/const.py b/apps/terminal/const.py index 5ae73ca0f..6d7a14f9d 100644 --- a/apps/terminal/const.py +++ b/apps/terminal/const.py @@ -131,10 +131,11 @@ class NativeClient(TextChoices): @classmethod def get_launch_command(cls, name, token, endpoint, os='windows'): + username = f'JMS-{token.id}' commands = { - cls.ssh: f'ssh {token.id}@{endpoint.host} -p {endpoint.ssh_port}', - cls.putty: f'putty.exe -ssh {token.id}@{endpoint.host} -P {endpoint.ssh_port}', - cls.xshell: f'xshell.exe -url ssh://{token.id}:{token.value}@{endpoint.host}:{endpoint.ssh_port}', + cls.ssh: f'ssh {username}@{endpoint.host} -p {endpoint.ssh_port}', + cls.putty: f'putty.exe -ssh {username}@{endpoint.host} -P {endpoint.ssh_port}', + cls.xshell: f'xshell.exe -url ssh://{username}:{token.value}@{endpoint.host}:{endpoint.ssh_port}', # cls.mysql: 'mysql -h {hostname} -P {port} -u {username} -p', # cls.psql: { # 'default': 'psql -h {hostname} -p {port} -U {username} -W',