https://github.com/flaviodelgrosso/docker-ssh-service
SSH service in Docker container
https://github.com/flaviodelgrosso/docker-ssh-service
docker remote-development service ssh
Last synced: 4 months ago
JSON representation
SSH service in Docker container
- Host: GitHub
- URL: https://github.com/flaviodelgrosso/docker-ssh-service
- Owner: flaviodelgrosso
- Created: 2023-07-16T14:37:53.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-07-16T14:51:05.000Z (almost 2 years ago)
- Last Synced: 2025-01-01T15:43:23.087Z (5 months ago)
- Topics: docker, remote-development, service, ssh
- Language: Shell
- Homepage:
- Size: 1000 Bytes
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker SSH Server
This project contains a Dockerfile and a build script to create and run an SSH server container based on Ubuntu. It allows you to easily set up an SSH server inside a Docker container.
## Getting Started
To get started, follow the steps below:
1. Clone this repository to your local machine.
2. Rename the `.env.example` file to `.env` and update the values of `SSH_USER` and `SSH_PWD` with your desired SSH username and password.
3. Open a terminal and navigate to the project directory.### Building the Docker Image
To build the Docker image, run the `build.sh` script with the container name as first argument:
```bash
./build.sh
```The script will read the values from the `.env` file and build the Docker image with the provided SSH username and password.
### Running the Container
After the Docker image is built, you can run the container using the following command:
```bash
docker run -it -d -p 22:22 --name
```Replace `` with the desired name for your container and `` with the name of the Docker image.
### Connecting to the SSH Server
To connect to the SSH server running inside the container, you can use an SSH client such as OpenSSH. Use the following command:
```bash
ssh -p 22 @
```Replace `` with the SSH username you set in the `.env` file, and `` with the IP address of the running container. You can obtain the IP address by running `docker inspect `.