Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--exit-with-children=no does not pass to ssh://Remote/N #3566

Closed
karlkleinpaste opened this issue Jun 24, 2022 · 3 comments
Closed

--exit-with-children=no does not pass to ssh://Remote/N #3566

karlkleinpaste opened this issue Jun 24, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@karlkleinpaste
Copy link

Describe the bug
Follow-on to #3553. Sorry, filing this slipped my mind for a week.

--exit-with-children=no is not being propagated to an ssh://RemoteHost/N destination.
Used -d ssh as suggested to trace the conversation. It appears that the option was just dropped.

Normal usage for me is that exit-with-children=yes is in ~/.xpra/xpra.conf because I nearly always use a terminal or something similar, but for certain specific needs (starting remote desktop using XDMCP), I need not to have a distinguished/followed/watched child, so --exit-with-children=no goes on the command line to supercede.

To Reproduce
xpra -d ssh start-desktop ssh://ph/7 --attach=no --resize-display=1856x960 --exit-with-children=no

Note specifically below:
2022-06-24 09:33:50,226 channel exec_command("/usr/bin/xpra" "_proxy_start_desktop" ":7" "--debug=ssh" "--resize-display=1856x960")

2022-06-24 09:33:48,941 debug enabled for xpra.net.ssh / ('network', 'ssh')
2022-06-24 09:33:48,994 debug enabled for xpra.scripts.parsing / ('ssh',)
2022-06-24 09:33:48,994 using paramiko ssh backend
2022-06-24 09:33:49,018 parsed user config '/home/karl/.ssh/config'
2022-06-24 09:33:49,019 112 hosts found
2022-06-24 09:33:49,024 got host config for 'ph': {'port': '7887', 'user': 'karl', 'forwardagent': 'yes', 'forwardx11': 'yes', 'forwardx11trusted': 'yes', 'preferredauthentications': 'publickey,keyboard-interactive,password', 'gssapiauthentication': 'yes', 'pubkeyacceptedkeytypes': '+ssh-dss', 'hostname': 'ph'}
2022-06-24 09:33:49,107 paramiko socket_connect: sockname=('172.17.2.2', 59316), peername=('172.17.2.1', 7887)
2022-06-24 09:33:49,108 starting thread (client mode): 0x5456b880
2022-06-24 09:33:49,108 Local version/idstring: SSH-2.0-paramiko_2.11.0
2022-06-24 09:33:49,182 Remote version/idstring: SSH-2.0-OpenSSH_8.7
2022-06-24 09:33:49,183 Connected (version 2.0, client OpenSSH_8.7)
2022-06-24 09:33:49,255 === Key exchange possibilities ===
2022-06-24 09:33:49,255 kex algos: curve25519-sha256, curve25519-sha256@libssh.org, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group-exchange-sha256, diffie-hellman-group14-sha256, diffie-hellman-group16-sha512, diffie-hellman-group18-sha512
2022-06-24 09:33:49,255 server key: rsa-sha2-512, rsa-sha2-256, ecdsa-sha2-nistp256, ssh-ed25519
2022-06-24 09:33:49,255 client encrypt: aes256-gcm@openssh.com, chacha20-poly1305@openssh.com, aes256-ctr, aes128-gcm@openssh.com, aes128-ctr
2022-06-24 09:33:49,255 server encrypt: aes256-gcm@openssh.com, chacha20-poly1305@openssh.com, aes256-ctr, aes128-gcm@openssh.com, aes128-ctr
2022-06-24 09:33:49,255 client mac: hmac-sha2-256-etm@openssh.com, hmac-sha1-etm@openssh.com, umac-128-etm@openssh.com, hmac-sha2-512-etm@openssh.com, hmac-sha2-256, hmac-sha1, umac-128@openssh.com, hmac-sha2-512
2022-06-24 09:33:49,255 server mac: hmac-sha2-256-etm@openssh.com, hmac-sha1-etm@openssh.com, umac-128-etm@openssh.com, hmac-sha2-512-etm@openssh.com, hmac-sha2-256, hmac-sha1, umac-128@openssh.com, hmac-sha2-512
2022-06-24 09:33:49,255 client compress: none, zlib@openssh.com
2022-06-24 09:33:49,255 server compress: none, zlib@openssh.com
2022-06-24 09:33:49,255 client lang: <none>
2022-06-24 09:33:49,255 server lang: <none>
2022-06-24 09:33:49,255 kex follows: False
2022-06-24 09:33:49,255 === Key exchange agreements ===
2022-06-24 09:33:49,255 Kex: curve25519-sha256@libssh.org
2022-06-24 09:33:49,255 HostKey: ssh-ed25519
2022-06-24 09:33:49,255 Cipher: aes128-ctr
2022-06-24 09:33:49,255 MAC: hmac-sha2-256
2022-06-24 09:33:49,255 Compression: none
2022-06-24 09:33:49,255 === End of kex handshake ===
2022-06-24 09:33:49,340 kex engine KexCurve25519 specified hash_algo <built-in function openssl_sha256>
2022-06-24 09:33:49,340 Switch to new keys ...
2022-06-24 09:33:49,340 do_ssh_paramiko_connect_to(<paramiko.Transport at 0x5456b880 (cipher aes128-ctr, 128 bits) (connected; awaiting auth)>, 'ph', 'karl', None, {'port': '7887', 'user': 'karl', 'forwardagent': 'yes', 'forwardx11': 'yes', 'forwardx11trusted': 'yes', 'preferredauthentications': 'publickey,keyboard-interactive,password', 'gssapiauthentication': 'yes', 'pubkeyacceptedkeytypes': '+ssh-dss', 'hostname': 'ph'}, ['/home/karl/.ssh/id_ed25519', '/home/karl/.ssh/id_ecdsa', '/home/karl/.ssh/id_rsa', '/home/karl/.ssh/id_dsa'], {'display_name': 'ssh://ph/7', 'type': 'ssh', 'proxy_command': ['_proxy_start_desktop'], 'exit_ssh': True, 'display': ':7', 'display_as_args': [':7', '--debug=ssh', '--resize-display=1856x960'], 'is_paramiko': True, 'host': 'ph', 'local': False, 'full_ssh': ['paramiko'], 'remote_xpra': ['xpra', '$XDG_RUNTIME_DIR/xpra/run-xpra', '/usr/local/bin/xpra', '~/.xpra/run-xpra', 'Xpra_cmd.exe']})
2022-06-24 09:33:49,340 SSH transport <paramiko.Transport at 0x5456b880 (cipher aes128-ctr, 128 bits) (connected; awaiting auth)>
2022-06-24 09:33:49,340 Got EXT_INFO: {'server-sig-algs': b'ssh-ed25519,sk-ssh-ed25519@openssh.com,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256@openssh.com,webauthn-sk-ecdsa-sha2-nistp256@openssh.com'}
2022-06-24 09:33:49,340 remote_server_key=MD5:80:14:e5:4f:31:eb:c6:a1:18:d0:0f:f2:fc:fa:9f:9c
2022-06-24 09:33:49,378 HostKeys.load(/home/karl/.ssh/known_hosts) successful
2022-06-24 09:33:49,378 host keys=<paramiko.hostkeys.HostKeys object at 0x7f41545c10c0>
2022-06-24 09:33:49,379 ed25519 host key 'MD5:80:14:e5:4f:31:eb:c6:a1:18:d0:0f:f2:fc:fa:9f:9c' OK for host 'ph'
2022-06-24 09:33:49,379 starting authentication, authentication methods: ['none', 'agent', 'key', 'password']
2022-06-24 09:33:49,379 auth=none
2022-06-24 09:33:49,379 trying none authentication
2022-06-24 09:33:49,513 userauth is OK
2022-06-24 09:33:49,579 Authentication type (none) not permitted.
2022-06-24 09:33:49,579 Allowed methods: ['publickey', 'gssapi-keyex', 'gssapi-with-mic', 'password']
2022-06-24 09:33:49,579 auth_none()
Traceback (most recent call last):
  File "/usr/lib64/python3.10/site-packages/xpra/net/ssh.py", line 582, in auth_none
    transport.auth_none(username)
  File "/usr/lib/python3.10/site-packages/paramiko/transport.py", line 1501, in auth_none
    return self.auth_handler.wait_for_response(my_event)
  File "/usr/lib/python3.10/site-packages/paramiko/auth_handler.py", line 259, in wait_for_response
    raise e
paramiko.ssh_exception.BadAuthenticationType: Bad authentication type; allowed types: ['publickey', 'gssapi-keyex', 'gssapi-with-mic', 'password']
2022-06-24 09:33:49,580 auth=agent
2022-06-24 09:33:49,580 agent keys: (<paramiko.agent.AgentKey object at 0x7f415462f130>, <paramiko.agent.AgentKey object at 0x7f41545c11e0>, <paramiko.agent.AgentKey object at 0x7f4154639a20>, <paramiko.agent.AgentKey object at 0x7f41546396c0>, <paramiko.agent.AgentKey object at 0x7f41546392a0>)
2022-06-24 09:33:49,580 trying ssh-agent key 'MD5:87:b4:ad:51:e8:75:69:76:fe:4f:7e:25:4e:03:70:02'
2022-06-24 09:33:49,647 userauth is OK
2022-06-24 09:33:49,648 Finalizing pubkey algorithm for key of type 'ssh-rsa'
2022-06-24 09:33:49,648 Our pubkey algorithm list: ['rsa-sha2-512', 'rsa-sha2-256', 'ssh-rsa']
2022-06-24 09:33:49,648 Server-side algorithm list: ['ssh-ed25519', 'sk-ssh-ed25519@openssh.com', 'ssh-rsa', 'rsa-sha2-256', 'rsa-sha2-512', 'ssh-dss', 'ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384', 'ecdsa-sha2-nistp521', 'sk-ecdsa-sha2-nistp256@openssh.com', 'webauthn-sk-ecdsa-sha2-nistp256@openssh.com']
2022-06-24 09:33:49,648 Agreed upon 'rsa-sha2-512' pubkey algorithm
2022-06-24 09:33:49,746 Authentication (publickey) successful!
2022-06-24 09:33:49,747 authenticated using agent and key 'MD5:87:b4:ad:51:e8:75:69:76:fe:4f:7e:25:4e:03:70:02'
2022-06-24 09:33:49,747 will try to run xpra from: ['xpra', '$XDG_RUNTIME_DIR/xpra/run-xpra', '/usr/local/bin/xpra', '~/.xpra/run-xpra', 'Xpra_cmd.exe']
2022-06-24 09:33:49,747 paramiko_run_test_command(transport, 'command -v xpra')
2022-06-24 09:33:49,747 [chan 0] Max packet in: 4096 bytes
2022-06-24 09:33:49,838 Received global request "hostkeys-00@openssh.com"
2022-06-24 09:33:49,838 Rejecting "hostkeys-00@openssh.com" global request from server.
2022-06-24 09:33:49,838 Debug msg: b'/home/karl/.ssh/authorized_keys:4: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding'
2022-06-24 09:33:49,945 [chan 0] Max packet out: 32768 bytes
2022-06-24 09:33:49,945 Secsh channel 0 opened.
2022-06-24 09:33:50,025 [chan find command -v xpra] Sesch channel 0 request ok
2022-06-24 09:33:50,025 exec_command returned
2022-06-24 09:33:50,025 exit status is not ready yet, sleeping
2022-06-24 09:33:50,032 [chan find command -v xpra] EOF received (find command -v xpra)
2022-06-24 09:33:50,032 [chan find command -v xpra] EOF sent (find command -v xpra)
2022-06-24 09:33:50,035 exec_command('command -v xpra')=0
2022-06-24 09:33:50,035 exec_command out='/usr/bin/xpra\n'
2022-06-24 09:33:50,035 exec_command err=''
2022-06-24 09:33:50,035 adding xpra_cmd='/usr/bin/xpra'
2022-06-24 09:33:50,035 cmd(['_proxy_start_desktop'], [':7', '--debug=ssh', '--resize-display=1856x960'])="/usr/bin/xpra" "_proxy_start_desktop" ":7" "--debug=ssh" "--resize-display=1856x960"
2022-06-24 09:33:50,035 trying to open SSH session, window-size=134217727, timeout=60
2022-06-24 09:33:50,035 [chan 1] Max packet in: 4096 bytes
2022-06-24 09:33:50,226 [chan 1] Max packet out: 32768 bytes
2022-06-24 09:33:50,226 Secsh channel 1 opened.
2022-06-24 09:33:50,226 channel exec_command("/usr/bin/xpra" "_proxy_start_desktop" ":7" "--debug=ssh" "--resize-display=1856x960")
2022-06-24 09:33:50,305 [chan run-xpra] Sesch channel 1 request ok
2022-06-24 09:33:50,557  SSH: 'xpra initialization error:'
2022-06-24 09:33:50,557  SSH: ' exit-with-children was specified but start-child* is missing!'
2022-06-24 09:33:50,561  SSH: '  File "/usr/lib64/python3.10/site-packages/xpra/scripts/main.py", line 143, in main'
2022-06-24 09:33:50,561  SSH: '    return run_mode(script_file, cmdline, err, options, args, mode, defaults)'
2022-06-24 09:33:50,561  SSH: '  File "/usr/lib64/python3.10/site-packages/xpra/scripts/main.py", line 417, in run_mode'
2022-06-24 09:33:50,561  SSH: '    return do_run_mode(script_file, cmdline, error_cb, options, args, mode, defaults)'
2022-06-24 09:33:50,561  SSH: '  File "/usr/lib64/python3.10/site-packages/xpra/scripts/main.py", line 452, in do_run_mode'
2022-06-24 09:33:50,561  SSH: '    return run_server(script_file, cmdline, error_cb, options, args, mode, defaults)'
2022-06-24 09:33:50,561  SSH: '  File "/usr/lib64/python3.10/site-packages/xpra/scripts/main.py", line 1782, in run_server'
2022-06-24 09:33:50,561  SSH: '    return do_run_server(script_file, cmdline, error_cb, options, args, mode, display, defaults)'
2022-06-24 09:33:50,561  SSH: '  File "/usr/lib64/python3.10/site-packages/xpra/scripts/server.py", line 673, in do_run_server'
2022-06-24 09:33:50,561  SSH: '    return _do_run_server(script_file, cmdline,'
2022-06-24 09:33:50,561  SSH: '  File "/usr/lib64/python3.10/site-packages/xpra/scripts/server.py", line 723, in _do_run_server'
2022-06-24 09:33:50,561  SSH: '    assert has_child_arg, "exit-with-children was specified but start-child* is missing!"'
2022-06-24 09:33:50,636  SSH: 'xpra initialization error:'
2022-06-24 09:33:50,636  SSH: ' failed to identify the new server display!'
2022-06-24 09:33:50,657 [chan run-xpra] EOF received (run-xpra)
2022-06-24 09:33:50,657 SSH EOF on stderr of run-xpra
2022-06-24 09:33:50,657 [chan run-xpra] EOF sent (run-xpra)
2022-06-24 09:33:50,660 Connection failed

System Information (please complete the following information):
F35 and xpra v4.4-r31319 all around.

@karlkleinpaste karlkleinpaste added the bug Something isn't working label Jun 24, 2022
@totaam
Copy link
Collaborator

totaam commented Jun 28, 2022

This is not a bug.
--exit-with-children=no is the default so the option is not forwarded.
--exit-with-children=yes is not the default, so it is forwarded.

@totaam totaam closed this as completed Jun 28, 2022
@totaam totaam added the invalid This doesn't seem right label Jun 28, 2022
@karlkleinpaste
Copy link
Author

I have to disagree with this. At the least, it makes for a different execution expectation, in local vs. ssh remote cases. That is, given that ~/.xpra/xpra.conf contains exit-with-children=yes at both local and remote sites (i.e. it is my default), giving a command including --exit-with-children=no for :N locally will behave oppositely for ssh://remote/N.

Since exit-with-children=yes is in remote xpra.conf, how would one override it?

I contend that the option should be forwarded because the user mentions it, or more generally, any explicit command line options should be forwarded, regardless of whether the mention coincides with the default.

@totaam
Copy link
Collaborator

totaam commented Jun 29, 2022

The commit above should do what you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants