{"id":20231637,"url":"https://github.com/mountainash/openssh-client","last_synced_at":"2025-12-30T21:27:22.443Z","repository":{"id":43021946,"uuid":"420477418","full_name":"mountainash/openssh-client","owner":"mountainash","description":"openssh-client + entrypoint to set up ssh-agent, ssh-add \u0026 known_hosts for easy CI/CD pipeline use.","archived":false,"fork":false,"pushed_at":"2024-05-28T10:40:31.000Z","size":41,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-29T04:23:35.224Z","etag":null,"topics":["cdci","deployment","devops","docker","docker-image","github","gitlab","hacktoberfest","pipeline","ssh"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/mountainash/openssh-client","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/mountainash.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-10-23T17:22:18.000Z","updated_at":"2024-06-10T18:57:43.450Z","dependencies_parsed_at":"2023-10-12T23:41:43.281Z","dependency_job_id":"4125b1d7-dbf0-486e-ae09-296c38e3c7cd","html_url":"https://github.com/mountainash/openssh-client","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mountainash%2Fopenssh-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mountainash%2Fopenssh-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mountainash%2Fopenssh-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mountainash%2Fopenssh-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mountainash","download_url":"https://codeload.github.com/mountainash/openssh-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241678130,"owners_count":20001680,"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":["cdci","deployment","devops","docker","docker-image","github","gitlab","hacktoberfest","pipeline","ssh"],"created_at":"2024-11-14T07:48:54.161Z","updated_at":"2025-12-30T21:27:22.417Z","avatar_url":"https://github.com/mountainash.png","language":"Shell","readme":"# OpenSSH Client\n\n[![Docker Hub pulls](https://badgen.net/docker/pulls/mountainash/openssh-client)](https://hub.docker.com/r/mountainash/openssh-client) [![GitLab Releases](https://badgen.net/gitlab/release/containeryard/openssh)](https://gitlab.com/containeryard/openssh/-/releases)\n\n\u003e A handy Docker Image for connecting through SSH to remote hosts with _optional_ support for SSH host keys.\n\n![Pufferfish](https://gitlab.com/containeryard/openssh/-/raw/14afda69422ca6c4dc91e49cf79de24f0a65b226/avatar.png)\n\nCan be used in a deployment pipeline to connect to a remote host, and run a git, a Docker `pull` or any CLI command. It's very small and lightweight, based on Alpine Linux.\n\n## Setup\n\nImage available on [Docker Hub](https://hub.docker.com/r/mountainash/openssh-client) or [GitLab Container Registry](https://gitlab.com/containeryard/openssh/container_registry/1422252).\n\n### Environment Variables\n\nThese variables are set in the CI/CD settings (these could be any CI/CD pipeline service eg. GitHub Actions, GitLab CI/CD, CircleCI, Jenkins, etc.):\n- `SSH_HOST` (remote's hostname)\n- `SSH_KNOWN_HOSTS` (host's key signature eg. `[172.31.98.99]:22222 ssh-ed25519 AAAAC3NzaC1lZDI1NTE...n9K9hnplyRGA3MJfe/wBoCVIaX`, can be set to `NoStrictHostKeyChecking` to not check)\n- `SSH_PRIVATE_KEY` (SSH private key added to the agent store)\n\n### Tool: Generating SSH_PRIVATE_KEY\n\nNeed some new keys? You can use this image to generate them (no polluting up your local machine with keys - and adding to your \"vector\").\n\n```sh\ndocker run --rm mountainash/openssh-client:latest ./keygen.sh\n```\n\nFour different types (dsa, ecdsa, ed25519, or rsa) public and private authentication keys will be printed to stdout. Pick your perferred key type and copy \u0026 paste into your CD/CI settings and remote server.\n\n### Tip: Getting SSH_KNOWN_HOSTS\n\nSSH to the server and run `ssh-keyscan` on the full domain name of the `SSH_HOST`:\n\n```sh\nssh-keyscan hostname.com\n```\n\nYou can also do it locally, but doing it on the server it's self prevents any man-in-the-middle shenanigans.\n\n### Example: GitLab CI/CD Pipeline\n\nCreate a `.gitlab-ci.yml` file in the root of your project to trigger SSH commands on a remote server and commit to the `master` branch (pre-cloning on the server would already be needed).\n\n```yml\ndeploy:\n  ## Suffix with latest with a SHA for better security\n  image: registry.gitlab.com/containeryard/openssh\n  only:\n    - master\n  environment:\n    name: production\n    url: https://domainname.com/\n  variables:\n    GIT_STRATEGY: none\n    GIT_SUBMODULE_STRATEGY: none\n  script:\n    - ssh $SSH_USER_NAME@$SSH_HOST \"cd /www \u0026\u0026 git pull $CI_REPOSITORY_URL \u0026\u0026 exit\"\n  allow_failure: false\n```\n\n### Example: GitHub Actions Workflow\n\nIn `./github/workflows/ssh-deploy.yml` (or similar). This will copy a file to a remote server on a push to the `main` branch.\n\n```yml\nname: Deploy to Remote Server\n\non:\n  push:\n    branches:\n      - main\n\njobs:\n  deploy:\n    name: Deploy to Remote Server\n    runs-on: ubuntu-latest\n    container:\n      image: mountainash/openssh-client:latest\n      env:\n        SSH_HOST: ${{ vars.SSH_HOST }}\n        SSH_KNOWN_HOSTS: ${{ vars.SSH_KNOWN_HOSTS }}\n        SSH_USER_NAME: ${{ vars.SSH_USER_NAME }}\n        SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}\n      volumes:\n          - ./:/app/\n    steps:\n      - name: Copy HTML to Remote Server\n        run: scp /app/sample.html $SSH_USER_NAME@$SSH_HOST:/home/mountainash/www/sitename/index.html\n```\n\n## Contribute\n\n- GitLab: \u003chttps://gitlab.com/containeryard/openssh\u003e\n- GitHub (mirror): \u003chttps://github.com/mountainash/openssh-client\u003e\n\n## Credits\n\n- Based on \u003chttps://github.com/chuckyblack/docker-openssh-client\u003e / \u003chttps://hub.docker.com/r/jaromirpufler/docker-openssh-client\u003e but added host keys support \u0026 keygen script\n- Pufferfish by [Catalina Montes from the Noun Project](https://thenounproject.com/term/pufferfish/181192/)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmountainash%2Fopenssh-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmountainash%2Fopenssh-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmountainash%2Fopenssh-client/lists"}