{"id":20178234,"url":"https://github.com/aoudiamoncef/ubuntu-sshd","last_synced_at":"2025-06-23T15:35:04.609Z","repository":{"id":194580164,"uuid":"690972653","full_name":"aoudiamoncef/ubuntu-sshd","owner":"aoudiamoncef","description":"This project provides a way to create a Docker image based on an official Ubuntu Image with an SSH server (SSHD) enabled","archived":false,"fork":false,"pushed_at":"2024-09-19T21:13:50.000Z","size":15,"stargazers_count":29,"open_issues_count":0,"forks_count":21,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T06:24:02.523Z","etag":null,"topics":["docker","docker-image","dockerhub","ssh","ssh-server","ubuntu2404lts"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/aoudiamoncef.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":"2023-09-13T08:51:12.000Z","updated_at":"2025-03-18T14:55:35.000Z","dependencies_parsed_at":"2024-06-20T05:12:12.922Z","dependency_job_id":"dde2e94e-2621-453e-b953-48791800becb","html_url":"https://github.com/aoudiamoncef/ubuntu-sshd","commit_stats":null,"previous_names":["aoudiamoncef/ubuntu-sshd"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aoudiamoncef/ubuntu-sshd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aoudiamoncef%2Fubuntu-sshd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aoudiamoncef%2Fubuntu-sshd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aoudiamoncef%2Fubuntu-sshd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aoudiamoncef%2Fubuntu-sshd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aoudiamoncef","download_url":"https://codeload.github.com/aoudiamoncef/ubuntu-sshd/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aoudiamoncef%2Fubuntu-sshd/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261505178,"owners_count":23168973,"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":["docker","docker-image","dockerhub","ssh","ssh-server","ubuntu2404lts"],"created_at":"2024-11-14T02:19:54.279Z","updated_at":"2025-06-23T15:35:04.578Z","avatar_url":"https://github.com/aoudiamoncef.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Docker Image CI](https://github.com/aoudiamoncef/ubuntu-sshd/actions/workflows/ci.yml/badge.svg)](https://github.com/aoudiamoncef/ubuntu-sshd/actions/workflows/ci.yml)\n[![Docker Image Deployment](https://github.com/aoudiamoncef/ubuntu-sshd/actions/workflows/cd.yml/badge.svg)](https://github.com/aoudiamoncef/ubuntu-sshd/actions/workflows/cd.yml)\n[![Docker Pulls](https://img.shields.io/docker/pulls/aoudiamoncef/ubuntu-sshd.svg)](https://hub.docker.com/r/aoudiamoncef/ubuntu-sshd)\n[![Maintenance](https://img.shields.io/badge/Maintained-Yes-green.svg)](https://github.com/aoudiamoncef/ubuntu-sshd)\n\nThis Docker image provides an Ubuntu 24.04 base with SSH server enabled. It allows you to easily create SSH-accessible containers via SSH keys or with a default username and password.\n\n## Usage\n\n### Cloning the Repository\n\nTo get started, clone the GitHub [repository](https://github.com/aoudiamoncef/ubuntu-sshd) containing the Dockerfile and\nscripts:\n\n```bash\ngit clone https://github.com/aoudiamoncef/ubuntu-sshd\ncd ubuntu-sshd\n```\n\n### Building the Docker Image\n\nBuild the Docker image from within the cloned repository directory:\n\n```bash\ndocker build -t my-ubuntu-sshd:latest .\n```\n\n### Running a Container\n\nTo run a container based on the image, use the following command:\n\n```bash\ndocker run -d \\\n  -p host-port:22 \\\n  -e SSH_USERNAME=myuser \\\n  -e SSH_PASSWORD=mysecretpassword \\\n  -e AUTHORIZED_KEYS=\"$(cat path/to/authorized_keys_file)\" \\\n  -e SSHD_CONFIG_ADDITIONAL=\"your_additional_config\" \\\n  -e SSHD_CONFIG_FILE=\"/path/to/your/sshd_config_file\" \\\n  my-ubuntu-sshd:latest\n```\n\n- `-d` runs the container in detached mode.\n- `-p host-port:22` maps a host port to port 22 in the container. Replace `host-port` with your desired port.\n- `-e SSH_USERNAME=myuser` sets the SSH username in the container. Replace `myuser` with your desired username.\n- `-e SSH_PASSWORD=mysecretpassword` sets the SSH user's password in the container. **This environment variable is\n  required**. Replace `mysecretpassword` with your desired password.\n- `-e AUTHORIZED_KEYS=\"$(cat path/to/authorized_keys_file)\"` sets authorized SSH keys in the container. Replace `path/to/authorized_keys_file` with the path to your authorized_keys file.\n- `-e SSHD_CONFIG_ADDITIONAL=\"your_additional_config\"` allows you to pass additional SSHD configuration. Replace\n  `your_additional_config` with your desired configuration.\n- `-e SSHD_CONFIG_FILE=\"/path/to/your/sshd_config_file\"` allows you to specify a file containing additional SSHD\n  configuration. Replace `/path/to/your/sshd_config_file` with the path to your configuration file.\n- `my-ubuntu-sshd:latest` should be replaced with your Docker image's name and tag.\n\n### SSH Access\n\nOnce the container is running, you can SSH into it using the following command:\n\n```bash\nssh -p host-port myuser@localhost\n```\n\n- `host-port` should match the port you specified when running the container.\n- Use the provided password or SSH key for authentication, depending on your configuration.\n\n### Note\n\n- If the `AUTHORIZED_KEYS` environment variable is empty when starting the container, it will still launch the SSH server, but no authorized keys will be configured. You have to mount your own authorized keys file or manually configure the keys in the container.\n- If `AUTHORIZED_KEYS` is provided, password authentication will be disabled for enhanced security.\n\n## License\n\nThis Docker image is provided under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faoudiamoncef%2Fubuntu-sshd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faoudiamoncef%2Fubuntu-sshd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faoudiamoncef%2Fubuntu-sshd/lists"}