{"id":15778944,"url":"https://github.com/tmdzk/hostfiletosshconfig","last_synced_at":"2026-04-29T23:32:07.943Z","repository":{"id":95059224,"uuid":"89978952","full_name":"tmdzk/HostfileToSSHConfig","owner":"tmdzk","description":"Shell script that transform your hostfile to a SSH Config","archived":false,"fork":false,"pushed_at":"2023-05-05T15:52:43.000Z","size":6,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-11T18:13:37.178Z","etag":null,"topics":["ansible","bash","config","hostfile","linux","ssh"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tmdzk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-05-02T01:35:20.000Z","updated_at":"2023-05-05T15:51:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"d9b6667f-e5c9-4c07-86b4-f459eef7a178","html_url":"https://github.com/tmdzk/HostfileToSSHConfig","commit_stats":{"total_commits":4,"total_committers":2,"mean_commits":2.0,"dds":0.5,"last_synced_commit":"90582928db7bdf64a187f1b1f046feccd57f437b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tmdzk/HostfileToSSHConfig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmdzk%2FHostfileToSSHConfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmdzk%2FHostfileToSSHConfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmdzk%2FHostfileToSSHConfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmdzk%2FHostfileToSSHConfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tmdzk","download_url":"https://codeload.github.com/tmdzk/HostfileToSSHConfig/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmdzk%2FHostfileToSSHConfig/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32448399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"ssl_error","status_checked_at":"2026-04-29T22:10:49.234Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["ansible","bash","config","hostfile","linux","ssh"],"created_at":"2024-10-04T18:01:38.222Z","updated_at":"2026-04-29T23:32:07.927Z","avatar_url":"https://github.com/tmdzk.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HostfileToSSHConfig\n\nFed up dealing with millions of IP address and wasting time looking for them ?\nHostfileToSSHConfig is a very simple bash script that transform your hostfile to an SSH config\n\nTo run it :\n  - Clone the repo\n  - Execute the main.sh\n  - ssh your server\n  - With the time you've just earned crack open a cold one :beer:\n\n### 1 - Clone the repo\n```sh\ngit clone https://github.com/TimDzik/HostfileToSSHConfig.git\n```\n### 2 - Execute the main.sh\n```sh\n./main.sh [YOUR_HOSTFILE_PATH] [YOUR_USER] [YOUR_SSHKEY_PATH] [YOUR_ENV]\n```\n```[YOUR_HOSTFILE_PATH]``` : The Hostfile you want to convert to SSH Config\n```[YOUR_USER]``` : User that will connect the server (root, ubuntu, your current user..)\n```[YOUR_SSHKEY_PATH]``` : Where is store your SSH key (Usually in ~/.ssh/mysshkey)\n```[YOUR_ENV] ```:  If you want to append the environnement to the server config (eg : staging, production). Setting up [YOUR_ENV] will allow you to have both staging and production in the same config.\n\nExample :\n```sh\n./main.sh staging ubuntu ~/.ssh/id_rsa staging\n```\n\n### SSH your server\n```php\nHost mysql1\n  HostName $MY_IP_ADDRESS\n  User ubuntu\n  IdentityFile  ~/.ssh/id_rsa\n  IdentitiesOnly yes\n```\n\nTo ssh mysql1 server, no need to check the Hostfile, your host provider or the config you've just generated. Only type in your terminal ssh then tab, It will propose you all servers from your ``~/.ssh/config``\n\nSo to SSH mysql run :\n```sh\nssh mysql1\n```\n\n### With the time you've just earned crack open a cold one :beer:\n :beer:\n\n### Improvements that needs to be done :\n- [X] Write a basic script\n- [X] Implement the ENV Variable\n- [ ] More checking especially if variables are set (make some of them optionnal like ENV)\n- [ ] Add the option to append to current config or overwrite it\n- [ ] Add some fancy checking and colors\n- [ ] Add an --help option\n- [ ] Grab some more info from hostfile (Port, other user different SSH KEY )\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmdzk%2Fhostfiletosshconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftmdzk%2Fhostfiletosshconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmdzk%2Fhostfiletosshconfig/lists"}