{"id":22688627,"url":"https://github.com/javanile/fake-ssh-server","last_synced_at":"2025-03-29T16:14:39.148Z","repository":{"id":41533390,"uuid":"277376595","full_name":"javanile/fake-ssh-server","owner":"javanile","description":"Docker container which can be used in SSH integration tests","archived":false,"fork":false,"pushed_at":"2020-07-20T19:57:19.000Z","size":10,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-04T16:50:38.787Z","etag":null,"topics":["bash","docker","integration-testing","ssh","ssh-server","test-automation","testing"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","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/javanile.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}},"created_at":"2020-07-05T20:16:42.000Z","updated_at":"2022-07-03T16:48:19.000Z","dependencies_parsed_at":"2022-09-21T12:24:35.281Z","dependency_job_id":null,"html_url":"https://github.com/javanile/fake-ssh-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javanile%2Ffake-ssh-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javanile%2Ffake-ssh-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javanile%2Ffake-ssh-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javanile%2Ffake-ssh-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/javanile","download_url":"https://codeload.github.com/javanile/fake-ssh-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246207509,"owners_count":20740723,"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":["bash","docker","integration-testing","ssh","ssh-server","test-automation","testing"],"created_at":"2024-12-10T00:15:15.237Z","updated_at":"2025-03-29T16:14:39.122Z","avatar_url":"https://github.com/javanile.png","language":"Dockerfile","readme":"# fake-ssh-server\n\n![Lint Code Base](https://github.com/javanile/fake-ssh-server/workflows/Lint%20Code%20Base/badge.svg)\n[![Build Status](https://travis-ci.org/javanile/fake-ssh-server.svg?branch=master)](https://travis-ci.org/javanile/fake-ssh-server)\n\nThis is used as a dummy SSH server in some of our integration tests.\n\n## Description\n\nThis is a lightweight SSH server in a docker container.\n\nThis image provides:\n - An Ubuntu LTS base image\n - Standard SSH server \n - User creation based on env variable\n - Home directory based on env variable\n - Ability to run in chroot\n - Ability to use SSH public key\n\n### Example\n\nMount contents of `./ssh-data` folder into sftp server inside container.\n\n```yml\nversion: '2'\n\nservices:\n  # SSHD Server\n  sshtest:\n    image: checkoutfinland/dummy-sftp-server\n    environment:\n      # (mandatory) Username for the login\n      USERNAME: sftp\n      # (optional) Use dummy ssh key you generated for this test\n      PUBLIC_KEY: ssh-rsa AAAA....\n      # (optional) Use custom path for AuthorizedKeysFile\n      PUBLIC_KEYS_PATH: /etc/ssh/authorized_keys\n      # (optional) Use the path of mapped volume, default: /in\n      FOLDER: /in\n      # (optional) put the $FOLDER inside chroot, default: 1\n      CHROOT: 1\n      # (optional) use custom port number, default: 22\n      PORT: 2238\n    cap_add:\n      # Required if you want to chroot\n      - SYS_ADMIN\n    security_opt:\n      # Required if you want to chroot\n      - apparmor:unconfined\n    ports:\n      - 2238:2238\n    volumes:\n      ./ssh-data:/in\n```\n\nVerify that it works by opening SSH shell to the docker container:\n```\n$ ssh -p 2238 ubuntu@localhost echo \"Hello World!\"\nHello World!\n```\n\n### Configuration\n\nConfiguration is done through environment variables. \n\nRequired:\n- USERNAME: the name for login.\n- PUBLIC_KEY: the public ssh key for login. (you need this or password)\n- PASSWORD: the password for login. (you need this or public key)\n- FOLDER: the home of the user.\n\nOptional:\n- CHROOT: if set to 1, enable chroot of user (prevent access to other folders than its home folder). Be aware, that \ncurrently this feature needs additionnal docker capabilities (see below).\n- OWNER_ID: the uid of the user. If not set automatically grabbed from the uid of the owner of the FOLDER.\n\n### Chroot \n\nIf you want to run the SSH server with chroot feature, the docker image has to be run with additional capabilities.\n\n    cap_add:\n      - SYS_ADMIN\n    security_opt:\n      - apparmor:unconfined\n\nThis is due to the use of `mount --bind` in the init script.\n\n**If someone has a better way to do, feel free to submit a pull request or a hint.**\n\n## License\n\nThis software is under [MIT](LICENSE) license.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavanile%2Ffake-ssh-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjavanile%2Ffake-ssh-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavanile%2Ffake-ssh-server/lists"}