{"id":26820394,"url":"https://github.com/zvdy/go-ssh-manager","last_synced_at":"2025-03-30T06:32:10.156Z","repository":{"id":256063583,"uuid":"854238960","full_name":"zvdy/go-ssh-manager","owner":"zvdy","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-08T19:14:15.000Z","size":1847,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-17T05:42:25.541Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/zvdy.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":"2024-09-08T18:32:19.000Z","updated_at":"2024-09-08T19:14:18.000Z","dependencies_parsed_at":"2024-09-08T20:09:12.747Z","dependency_job_id":"3f997718-27c0-422a-9017-2eb00630862f","html_url":"https://github.com/zvdy/go-ssh-manager","commit_stats":null,"previous_names":["zvdy/go-branch-manager"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zvdy%2Fgo-ssh-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zvdy%2Fgo-ssh-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zvdy%2Fgo-ssh-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zvdy%2Fgo-ssh-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zvdy","download_url":"https://codeload.github.com/zvdy/go-ssh-manager/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246285645,"owners_count":20752947,"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":[],"created_at":"2025-03-30T06:31:50.820Z","updated_at":"2025-03-30T06:32:10.142Z","avatar_url":"https://github.com/zvdy.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SSH Server Selector\n\nThis project allows you to select an SSH server and an SSH key using [`fzf`] and then connect to the selected server using the selected key.\n\n## Prerequisites\n\n- Go (Golang) installed\n- [`fzf`] installed\n- SSH keys stored in the [`authorized_keys/`] directory\n- A JSON file named [`servers.json`] with the server details\n\n## JSON File Format\n\nThe [`servers.json`] file should be structured as follows:\n\n```json\n{\n    \"servers\": {\n        \"group1\": {\n            \"ssh-servers\": [\n                \"ssh-server1 localhost 2222\",\n                \"ssh-server2 localhost 2223\",\n                \"ssh-server3 localhost 2224\"\n            ]\n        }\n    }\n}\n```\n\n## How to Run\n\n[![asciicast](https://asciinema.org/a/GkPTqrdm7xZw9kwv14JGq9jrm.svg)](https://asciinema.org/a/GkPTqrdm7xZw9kwv14JGq9jrm)\n\n1. Clone the repository and navigate to the project directory.\n\n2. Ensure you have a [`servers.json`] file in the project directory with the correct format.\n\n3. Ensure you have your SSH keys in the [`authorized_keys/`] directory.\n\n4. Build the Go program:\n\n    ```sh\n    go build -o ssh-selector main.go\n    ```\n\n5. Run the program:\n\n    ```sh\n    ./ssh-selector\n    ```\n\n## How It Works\n\n1. The program reads the [`servers.json`] file to get the list of servers.\n2. It writes the list of servers to a temporary file.\n3. It uses [`fzf`] to allow you to select a server from the list.\n4. It reads the [`authorized_keys/`] directory to get the list of SSH keys.\n5. It writes the list of SSH keys to another temporary file.\n6. It uses [`fzf`] to allow you to select an SSH key from the list.\n7. It removes the old host key for the selected server.\n8. It connects to the selected server using the selected SSH key.\n\n## Example\n\n```sh\n./ssh-selector\n```\n\nYou will be prompted to select a server and then an SSH key. After making your selections, the program will connect to the selected server using the selected SSH key.\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file for details.\n\n## Contributing\n\nFeel free to submit issues and pull requests for improvements and bug fixes.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzvdy%2Fgo-ssh-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzvdy%2Fgo-ssh-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzvdy%2Fgo-ssh-manager/lists"}