Skip to content

Conversation

@dalthviz
Copy link
Member

@dalthviz dalthviz commented May 2, 2025

Description of Changes

A preview:

image image
image image

Some resources that could be useful to add for more info on what config is supported by AsyncSSH: https://asyncssh.readthedocs.io/en/latest/api.html#supportedclientconfigoptions

Some other notes:

  • Should other fields (username, port, password, client_keys and passpharse) be available but optional? Without those being provided I guess the only way to connect via a config file would be to set all of them in the config file. Also, something to note is that password and passphrase aren't part of the OpenSSH client config specification, so the config will need to have the IdentityFile keyword set to a key without passphrase/or to a key with a passphrase but that is being handle via ssh-agent and in a session where the passphrase has already been provided if I understand correctly (at least that seems needed from my local testingwhen trying to establish a connection via a config file 🤔).

Issue(s) Resolved

Fixes #22464

Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

I certify the above statement is true and correct: dalthviz

@dalthviz dalthviz added this to the v6.1.0a3 milestone May 2, 2025
@dalthviz dalthviz self-assigned this May 2, 2025
@dalthviz dalthviz changed the title [WIP] PR: Finish support for OpenSSH client config file specification (Remote Client) PR: Finish support for OpenSSH client config file specification (Remote Client) May 2, 2025
@dalthviz dalthviz marked this pull request as ready for review May 2, 2025 23:41
@dalthviz dalthviz requested a review from ccordoba12 May 3, 2025 00:07
@ccordoba12
Copy link
Member

Should other fields (username, port, password, client_keys and passpharse) be available but optional? Without those being provided I guess the only way to connect via a config file would be to set all of them in the config file.

Ok, in that case I think we must provide those fields so users can optionally set them. I thought they were provided by the config file only, but it is (of course) a security risk to set a password/passphrase in a plain text file.

So, please do that as part of this PR.

@dalthviz dalthviz force-pushed the fixes_issue_22464 branch from d49c77c to f8957be Compare May 9, 2025 01:01
@dalthviz dalthviz requested review from ccordoba12 and removed request for ccordoba12 May 9, 2025 01:03
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dalthviz, this still needs more work to do more validatations for the info introduced in this new page.

@dalthviz dalthviz changed the title PR: Finish support for OpenSSH client config file specification (Remote Client) [WIP] PR: Finish support for OpenSSH client config file specification (Remote Client) May 26, 2025
@ccordoba12 ccordoba12 modified the milestones: v6.1.0a3, v6.1.0a4 Jun 5, 2025
@dalthviz dalthviz changed the title [WIP] PR: Finish support for OpenSSH client config file specification (Remote Client) PR: Finish support for OpenSSH client config file specification (Remote Client) Jul 8, 2025
@dalthviz dalthviz requested a review from ccordoba12 July 9, 2025 23:36
@dalthviz dalthviz removed this from the v6.1.0a4 milestone Jul 15, 2025
@CAM-Gerlach
Copy link
Member

I am also rather uncomfortable having Spyder store my password, especially the passphrase for my key file. I store important passwords in one dedicated password manager. I don't like random programs storing my passwords because security is hard. I did not actually play with the code, so maybe there is a way around having Spyder store the password.

@jitseniesen I agree with having a password prompt where it is only persisted in memory (or only ephemerally), but FWIW, Spyder isn't actually storing your password (which would indeed be a horrible security practice), your OS is storing it in its central secure vault, which even if you use a separate password manager (as I've done for the past ~two decades, Bitwarden currently and LastPass long ago) is still going to get used to some extent for secure storage by properly-written applications. For example, unless you type your GitHub pw or SSH/keyfile passphrase every time you interact with GitHub or any remote Git repo (or on every commit, if you sign them on demand with -S or automatically with commit.gpgsign, as I do) those same credentials are getting stored and retrieved from the system secure vault.

@CAM-Gerlach CAM-Gerlach marked this pull request as draft January 6, 2026 21:27
@dalthviz dalthviz changed the title [WIP] PR: Finish support for OpenSSH client config file specification (Remote Client) PR: Finish support for OpenSSH client config file specification (Remote Client) Jan 8, 2026
@dalthviz dalthviz marked this pull request as ready for review January 8, 2026 22:55
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dalthviz for your continued work on this!

@ccordoba12 ccordoba12 changed the title PR: Finish support for OpenSSH client config file specification (Remote Client) PR: Implement support for OpenSSH client config files (Remote Client) Jan 16, 2026
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last suggestions for you @dalthviz.

@ccordoba12
Copy link
Member

@dalthviz, I'm also getting this traceback after trying to open the remote connections dialog for the second time (the first time it was shown as expected, i.e. I didn't get the error I mentioned before):

Traceback (most recent call last):
  File "/home/carlos/Projects/spyder/spyder/spyder/plugins/remoteclient/widgets/container.py", line 167, in _show_connection_dialog
    self._connection_dialog = dlg = ConnectionDialog(self)
                                    ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/carlos/Projects/spyder/spyder/spyder/plugins/remoteclient/widgets/connectiondialog.py", line 67, in __init__
    self._add_saved_connection_pages()
  File "/home/carlos/Projects/spyder/spyder/spyder/plugins/remoteclient/widgets/connectiondialog.py", line 386, in _add_saved_connection_pages
    self._add_connection_page(host_id=id_, new=False)
  File "/home/carlos/Projects/spyder/spyder/spyder/plugins/remoteclient/widgets/connectiondialog.py", line 369, in _add_connection_page
    page.add_logs(self._container.client_logs.get(host_id, []))
  File "/home/carlos/Projects/spyder/spyder/spyder/plugins/remoteclient/widgets/connectionpages.py", line 1414, in add_logs
    self.status_widget.add_logs(logs)
    ^^^^^^^^^^^^^^^^^^
AttributeError: 'ConnectionPage' object has no attribute 'status_widget'

@dalthviz dalthviz changed the title PR: Implement support for OpenSSH client config files (Remote Client) [WIP] PR: Implement support for OpenSSH client config files (Remote Client) Jan 27, 2026
FIXED_SIZE = True
MIN_WIDTH = 895 if MAC else (810 if WIN else 860)
MIN_HEIGHT = 740 if MAC else (655 if WIN else 690)
MIN_HEIGHT = 855 if MAC else (780 if WIN else 795)
Copy link
Member

@ccordoba12 ccordoba12 Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dalthviz, I selected these height values to have the necessary space in the dialog to show the validation warnings.

However, you're reducing them even when you're also adding a new field for the config file. Did you check that things still look good with these changes?

Copy link
Member

@ccordoba12 ccordoba12 Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I got confused. My comment should have been if you checked that the new values look good with the new field you added and the validation warnings.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest commit adds some changes for related values on Windows. I'm missing to check on macOS and Linux

@dalthviz
Copy link
Member Author

/show binder

@github-actions
Copy link

Binder 👈 Launch a Binder instance on this branch

@dalthviz dalthviz changed the title [WIP] PR: Implement support for OpenSSH client config files (Remote Client) PR: Implement support for OpenSSH client config files (Remote Client) Jan 30, 2026
@dalthviz dalthviz requested a review from ccordoba12 January 30, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: support openssh config files for remote connections

4 participants