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

x11-wm/xpra-4.2{,.1,.2}: Comment lines are deleted from ~/.ssh/known_hosts #3266

Closed
holgersson32644 opened this issue Sep 13, 2021 · 3 comments

Comments

@holgersson32644
Copy link

Hi,
if xpra connects to a yet unkown host it ask if the users wants to accept the server's key.
If the user accept, the whole ~/.ssh/known_hosts file is rewritten and all comment lines are stripped out. I tested versions xpra-4.2 to 4.2.2 on Gentoo with openssh-8.7_p1-r2.

Please fix this.

Kind reards,
Nils

@totaam
Copy link
Collaborator

totaam commented Sep 14, 2021

This is not an xpra bug but a bug in paramiko.

In the default configuration, we rely on paramiko for implementing the ssh transport and call this function:

xpra/xpra/net/ssh.py

Lines 566 to 567 in ed33f52

host_keys.add(host, host_key.get_name(), host_key)
host_keys.save(host_keys_filename)

The problem is that when paramiko loads the keys it just skips all the comments:
https://github.com/paramiko/paramiko/blob/33daa8e541cb91cdee01a085c368e1b388472e6a/paramiko/hostkeys.py#L98-L99

Please file a ticket there if you care: https://github.com/paramiko/paramiko or perhaps in this more active fork: https://github.com/ploxiln/paramiko-ng

In the meantime, you can avoid this issue entirely with: xpra --ssh=ssh.

@totaam totaam closed this as completed Sep 14, 2021
@holgersson32644
Copy link
Author

You're right, thanks for the detailed hints!

@holgersson32644
Copy link
Author

I guess paramiko won't fix this, as there is already a five year old bug there :(

paramiko/paramiko#680

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants