Get default user from ssh config file
Nobody has claimed this yet.
- Dominant language
- Perl
- Stars
- 737
- Forks
- 214
- PR merge metrics
- No merged PRs in 30d
Description
Currently rex tries to get the username to be used for making an SSH connection from different places, in order as seen in Rex::Config->get_user:
REX_USERenvironment variableusersetting in Rexfilegetlogingetpwuid($<)
It would be nice if we could try using the username set in ~/.ssh/config for a given host. Reading and parsing the SSH config file is already there in Rex::Config, but we probably need to somehow pass the servername in question and see if it matches any of the SSH config entries.
Contributor guide
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 in Rex::Config, especially Rex::Config->get_user and the existing ~/.ssh/config parsing. Trace how the target server name is available during SSH setup, then determine how a matching SSH config user should fit into the stated username lookup order. Done means a matching configured SSH username is used for that host without changing the existing fallbacks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- perl
- Domain
- devops, networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100