{"id":21143990,"url":"https://github.com/rakshazi/ssh-context","last_synced_at":"2026-04-24T18:32:49.040Z","repository":{"id":101267013,"uuid":"139137783","full_name":"rakshazi/ssh-context","owner":"rakshazi","description":"Implementing contexts for ssh in kubectl way","archived":false,"fork":false,"pushed_at":"2020-12-08T11:01:01.000Z","size":6,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-21T07:11:34.229Z","etag":null,"topics":["content-management","ssh","ssh-client","ssh-config","ssh-context","ssh-key","structure"],"latest_commit_sha":null,"homepage":null,"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/rakshazi.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":"2018-06-29T10:45:04.000Z","updated_at":"2020-12-08T10:59:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"9819685e-aea7-4481-90c5-2ead4aefb03e","html_url":"https://github.com/rakshazi/ssh-context","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rakshazi%2Fssh-context","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rakshazi%2Fssh-context/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rakshazi%2Fssh-context/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rakshazi%2Fssh-context/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rakshazi","download_url":"https://codeload.github.com/rakshazi/ssh-context/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243581422,"owners_count":20314230,"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":["content-management","ssh","ssh-client","ssh-config","ssh-context","ssh-key","structure"],"created_at":"2024-11-20T08:05:11.968Z","updated_at":"2025-12-28T18:31:39.992Z","avatar_url":"https://github.com/rakshazi.png","language":"Shell","funding_links":["https://liberapay.com/rakshazi/donate"],"categories":[],"sub_categories":[],"readme":"# ssh-context [![Donate](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/rakshazi/donate)\n\nBash wrapper around ssh which provides you ability to use contexts (as in kubectl) for SSH.\n\nBetter to describe it with example.\n\n1. You are developer involved in multiple projects. Each project has own dev/staging/production servers, git services, ssh keys, etc.\n2. You don't want to manually enter ssh key location each time (or mix your ssh config file).\n3. You want to share ssh config of one of the projects.\n4. It's not usable to do that with standard ssh toolchain\n\nAnd here is ssh-context.\n\n1. Project = context\n2. Context = separate ssh config, keys, git repos, etc.\n3. Use full power of isolated ssh config\n\n## Installation\n\nJust place `ssh-context` bash script in any location from your `$PATH`, `chmod +x` against it and run `ssh-context bootstrap` to init file structure\n\n### Optional: Set ssh-context as alias for ssh\n\n**Bash**: Add this alias to `.bashrc` or `.bash_profile` (for OSX):\n\n**ZSH**: Add this alias to `.zshrc`\n\n**Fish**: Add this alias to `config.fish`\n\n```bash\nalias ssh=\"ssh-context wrapper\"\n```\n\n### Set context per git repo\n\nIf you have multiple git repos, like `project1`, `project2`, `projectN`, etc. you may want to use them with different contexts.\nIn that case, run `ssh-context switch CONTEXT_YOU_WANT_TO_USE_FOR_THAT_GIT_REPO` and context name will be saved to `git config ssh.context` var\nin your local repo (remote not affected).\n\n## Usage\n\n**Install ssh-context**\n\n```bash\nssh-context bootstrap\n```\n\n**Create new context**\n\n```bash\nssh-context init myproject\n```\n\n**Switch context**\n\n\u003e **NOTE**: if you run `switch` inside the folder with git repo,\n\u003e context name will be saved to `git config ssh.context`,\n\u003e so next time when you will ssh from that folder, context from `git config ssh.context`\n\u003e will be used automaticly, if you don't set context name explicitly.\n\n```bash\nssh-context switch context_name\n```\n\n**Connect with current context**\n\n```bash\nssh-context wrapper \u003cssh args\u003e\n# example:\nssh-context wrapper -vv user@server\n```\n\n**Connect with another context**\n\n```bash\nssh-context wrapper \u003ccontext\u003e \u003cssh args\u003e\n# example:\nssh-context wrapper anotherproject server\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frakshazi%2Fssh-context","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frakshazi%2Fssh-context","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frakshazi%2Fssh-context/lists"}