{"id":15404515,"url":"https://github.com/k1low/sshc","last_synced_at":"2025-04-16T21:18:42.624Z","repository":{"id":35014033,"uuid":"160051791","full_name":"k1LoW/sshc","owner":"k1LoW","description":"sshc.NewClient() returns *ssh.Client using ssh_config(5)","archived":false,"fork":false,"pushed_at":"2024-12-11T23:32:35.000Z","size":154,"stargazers_count":11,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-29T05:41:34.663Z","etag":null,"topics":["ssh-client","ssh-config"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/k1LoW.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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},"funding":{"github":"k1LoW","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2018-12-02T13:45:37.000Z","updated_at":"2024-11-01T16:39:03.000Z","dependencies_parsed_at":"2022-08-08T04:00:18.113Z","dependency_job_id":"e614a8c6-ade9-4c4e-ac16-b10ea53812c0","html_url":"https://github.com/k1LoW/sshc","commit_stats":{"total_commits":173,"total_committers":6,"mean_commits":"28.833333333333332","dds":"0.19075144508670516","last_synced_commit":"0b798af7a7e1680f051ddf747a5224cd3c5acc7d"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k1LoW%2Fsshc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k1LoW%2Fsshc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k1LoW%2Fsshc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k1LoW%2Fsshc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/k1LoW","download_url":"https://codeload.github.com/k1LoW/sshc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249277952,"owners_count":21242642,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["ssh-client","ssh-config"],"created_at":"2024-10-01T16:13:28.024Z","updated_at":"2025-04-16T21:18:42.591Z","avatar_url":"https://github.com/k1LoW.png","language":"Go","funding_links":["https://github.com/sponsors/k1LoW"],"categories":[],"sub_categories":[],"readme":"# sshc [![Build Status](https://github.com/k1LoW/sshc/workflows/build/badge.svg)](https://github.com/k1LoW/sshc/actions) [![Go Reference](https://pkg.go.dev/badge/github.com/k1LoW/sshc/v4.svg)](https://pkg.go.dev/github.com/k1LoW/sshc/v4) ![Coverage](https://raw.githubusercontent.com/k1LoW/octocovs/main/badges/k1LoW/sshc/coverage.svg) ![Code to Test Ratio](https://raw.githubusercontent.com/k1LoW/octocovs/main/badges/k1LoW/sshc/ratio.svg)\n\n`sshc.NewClient()` returns `*ssh.Client` using [ssh_config(5)](https://linux.die.net/man/5/ssh_config)\n\n## Usage\n\nDescribe `~/.ssh/config`.\n\n```\nHost myhost\n  HostName 203.0.113.1\n  User k1low\n  Port 10022\n  IdentityFile ~/.ssh/myhost_rsa\n```\n\nUse `sshc.NewClient()` as follows\n\n``` go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"log\"\n\n\t\"github.com/k1LoW/sshc/v4\"\n)\n\nfunc main() {\n\tclient, err := sshc.NewClient(\"myhost\")\n\tif err != nil {\n\t\tlog.Fatalf(\"error: %v\", err)\n\t}\n\tsession, err := client.NewSession()\n\tif err != nil {\n\t\tlog.Fatalf(\"error: %v\", err)\n\t}\n\tdefer session.Close()\n\tvar stdout = \u0026bytes.Buffer{}\n\tsession.Stdout = stdout\n\terr = session.Run(\"hostname\")\n\tif err != nil {\n\t\tlog.Fatalf(\"error: %v\", err)\n\t}\n\tlog.Printf(\"result: %s\", stdout.String())\n}\n```\n\n### sshc.Option\n\n``` go\nclient, err := sshc.NewClient(\"myhost\", User(\"k1low\"), Port(1022))\n```\n\nSee [godoc page](https://pkg.go.dev/github.com/k1LoW/sshc/v4#Option)\n\n## Supported ssh_config keywords\n\n- Hostname\n- Port\n- User\n- IdentityFile\n- ProxyCommand\n- ProxyJump\n\n## References\n\n- https://github.com/kevinburke/ssh_config\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk1low%2Fsshc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fk1low%2Fsshc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk1low%2Fsshc/lists"}