{"id":20586374,"url":"https://github.com/piger/sshconfig","last_synced_at":"2026-05-28T01:31:32.613Z","repository":{"id":66836417,"uuid":"122670837","full_name":"piger/sshconfig","owner":"piger","description":"This package implements a simple parser for the ssh_config(5) configuration file used by OpenSSH.","archived":false,"fork":false,"pushed_at":"2023-05-12T14:49:59.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-12T07:29:08.293Z","etag":null,"topics":["go","golang","parser","ssh","ssh-config"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/piger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-23T20:45:35.000Z","updated_at":"2021-11-15T23:22:32.000Z","dependencies_parsed_at":"2024-06-20T04:07:10.054Z","dependency_job_id":"635bfca7-af04-4647-a868-73bac7798d9f","html_url":"https://github.com/piger/sshconfig","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/piger/sshconfig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piger%2Fsshconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piger%2Fsshconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piger%2Fsshconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piger%2Fsshconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/piger","download_url":"https://codeload.github.com/piger/sshconfig/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piger%2Fsshconfig/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33590884,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","parser","ssh","ssh-config"],"created_at":"2024-11-16T07:11:18.032Z","updated_at":"2026-05-28T01:31:32.588Z","avatar_url":"https://github.com/piger.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenSSH ssh_config(5) parser\n\nThis package implements a simple parser for the `ssh_config(5)` configuration file used by\nOpenSSH.\n\nThis package at the moment only supports a subset of the syntax used by `ssh_config(5)`; the current\nimplemented features are:\n\n- consider only the first value found for each option\n- expand some tokens (like `%h` and `%p`) for specific options (e.g. `ProxyCommand`)\n- `Host` pattern matching and patterns negation are supported\n\nSee the documentation at [godoc.org](https://godoc.org/github.com/piger/sshconfig).\n\n## Example usage\n\nYou create `SSHConfig` objects by calling `ReadSSHConfig(filename string)` which can be used to\nlookup SSH options for a specific name (which can be either a hostname or a *alias*).\n\n    import (\n      \"github.com/piger/sshconfig\"\n    )\n\n    sshConfig, err := ReadSSHConfig(\"/home/myuser/.ssh/config)\n    if err != nil {\n      log.Fatal(err)\n    }\n\n    hostConfig, err := sshConfig.Lookup(\"db1.example.com\")\n    if err != nil {\n      log.Fatal(err)\n    }\n\n    if opt, ok := hostConfig[\"hostname\"]; ok {\n        fmt.Printf(\"ProxyCommand for db1: %s\", opt)\n    }\n\n## Notes\n\n- Option names are converted to lowercase during parsing of the configuration file\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiger%2Fsshconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiger%2Fsshconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiger%2Fsshconfig/lists"}