change: print the user name if connecting via ssh

this is similar to the message that gitlab produces:

$ ssh -T aur.archlinux.org
Welcome to AUR, gromit! Interactive shell is disabled.
Try `ssh ssh://aur@aur.archlinux.org help` for a list of commands.

$ ssh -T gitlab.archlinux.org
Welcome to GitLab, @gromit!

Signed-off-by: Christian Heusel <christian@heusel.eu>
This commit is contained in:
Christian Heusel 2023-06-08 12:42:31 +02:00
parent e9cc2fb437
commit 26b2566b3f
No known key found for this signature in database
GPG key ID: C047D4F328B52585

View file

@ -648,7 +648,7 @@ def main():
ssh_client = os.environ.get("SSH_CLIENT") ssh_client = os.environ.get("SSH_CLIENT")
if not ssh_cmd: if not ssh_cmd:
die_with_help("Interactive shell is disabled.") die_with_help(f"Welcome to AUR, {user}! Interactive shell is disabled.")
cmdargv = shlex.split(ssh_cmd) cmdargv = shlex.split(ssh_cmd)
action = cmdargv[0] action = cmdargv[0]
remote_addr = ssh_client.split(" ")[0] if ssh_client else None remote_addr = ssh_client.split(" ")[0] if ssh_client else None