SSHConfig.parse messes up when host is different from hostname
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 9.9k
- Forks
- 2.1k
- PR merge metrics
- No merged PRs in 30d
Description
I guess this is a bug.
paramiko.config.SSHConfig.parse messes up if host is different from hostname in the shh config file.
Host host1
HostName 11.222.333.444
User username
IdentityFile C:\Users\xxx\ssh\id_rsa
returns:
{'hostname': '11.222.333.444'}
which is missing some variables
Host 11.222.333.444
HostName 11.222.333.444
User username
IdentityFile C:\Users\xxx\ssh\id_rsa
returns:
{'hostname': '11.222.333.444', 'identityfile': ['C:\Users\xxx\ssh\id_rsa'], 'user': 'username'}
which is the output that i expects
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with paramiko.config.SSHConfig.parse and reproduce the two SSH configuration examples from the issue. Trace why HostName matching causes User and IdentityFile to be omitted, then verify that parsing a different Host and HostName preserves those variables as shown in the expected output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100