Debian with OpenSSH
393
Debian OS is a stable, secure, and open-source operating system developed by a global community. Known for its extensive software repository and robust package management, Debian is ideal for various uses, including servers and desktops, and serves as the foundation for many other Linux distributions.
If you are familiar with building containers, you can easily build a container yourself in minutes on a device using a Dockerfile.
The tagged containers in this repository were built based on the following Dockerfile:
FROM debian:12.5
RUN apt-get update
RUN apt-get install -y openssh-server sudo python3 curl iproute2
RUN mkdir /var/run/sshd && /etc/init.d/ssh start && /etc/init.d/ssh stop
WORKDIR /tmp
RUN echo "#!/bin/bash\n" \
"if ! id -u '\$USER' >/dev/null 2>&1; then\n" \
"useradd --create-home --shell /bin/bash \$USER\n" \
"echo \$USER:\$PASSWD | chpasswd\n" \
"adduser \$USER sudo\n" \
"echo \$USER ' ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/010_\$USER-nopasswd\n" \
'sed -i -e "s;#Port 22;Port ${SSHPORT};" /etc/ssh/sshd_config\n' \
"fi\n" \
"/etc/init.d/ssh start &\n" \
"tail -f /dev/null\n" \
> entrypoint.sh
RUN chmod +x entrypoint.sh
ENTRYPOINT ["/tmp/entrypoint.sh"]
The Dockerfile is set up to enable the container to utilize three environment variables: USER, PASSWD, and SSHPORT, for accessing it via an SSH connection post-deployment.
Ensure that you configure these three variables according to your requirements when starting the container. Make sure the port configured with SSHPORT is not occupied already by another application on the container's host.
To deploy a container simply call the following line. (Replace [tag] with the intended repo tag)
docker run -it -d --restart=always --env SSHPORT=23 --env USER=admin --env PASSWD=admin --network=host --privileged --name=debian hilschernetiotedge/debian:[tag]
The provided command line example explicitly launches the container in privilege and host mode, setting the SSH port to 23, with the username admin and password admin. Please adjust these settings in your command line to meet your specific requirement of the container.
Upon container startup, the SSH server is configured to listen on the specified SSHPORT environment variable. Tools such as putty can then be used to access the container over and SSH connection.
Executing privileged operations within the container requires root access, which may necessitate using the sudo prefix in a command line.
The container doesn't have to operate exclusively in privileged mode. But this mode option lifts the standard Docker enforced container limitations. With this setting the container and the applications inside are the getting (almost) all capabilities as if running on the container's host directly.
The container doesn't have to operate exclusively in network mode host. If you configure it differently, please remember to utilize the --publish option when running the Docker container, mapping the configured SSHPORT to a port of your choice.
HILSCHER DOES NOT WARRANT THAT THE FUNCTIONS CONTAINED IN THE SOFTWARE WILL MEET YOUR REQUIREMENTS, OR THAT THE OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT DEFECTS IN THE SOFTWARE WILL BE CORRECTED BY THE 3RD PARTY COMPANY.
Content type
Image
Digest
sha256:9cfb4fe9f…
Size
101.8 MB
Last updated
over 2 years ago
docker pull hilschernetiotedge/debian:12.5