Last active
May 17, 2022 09:43
-
-
Save TonyPepeBear/2b9ccb5f7a0186ed6a3ec9643149b49e to your computer and use it in GitHub Desktop.
ubuntu-ssh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.2" | |
services: | |
ubuntu1: | |
image: ubuntu:ssh | |
ports: | |
- "8001:22" | |
ubuntu2: | |
image: ubuntu:ssh | |
ports: | |
- "8002:22" | |
ubuntu3: | |
image: ubuntu:ssh | |
ports: | |
- "8003:22" | |
ubuntu4: | |
image: ubuntu:ssh | |
ports: | |
- "8004:22" | |
ubuntu5: | |
image: ubuntu:ssh | |
ports: | |
- "8005:22" | |
ubuntu6: | |
image: ubuntu:ssh | |
ports: | |
- "8006:22" | |
ubuntu7: | |
image: ubuntu:ssh | |
ports: | |
- "8007:22" | |
ubuntu8: | |
image: ubuntu:ssh | |
ports: | |
- "8008:22" | |
ubuntu9: | |
image: ubuntu:ssh | |
ports: | |
- "8009:22" | |
ubuntu10: | |
image: ubuntu:ssh | |
ports: | |
- "8010:22" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ARG UBUNTU_VERSION=latest | |
FROM ubuntu:${UBUNTU_VERSION} | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN apt update \ | |
&& apt install -y openssh-server ssh sudo git vim \ | |
&& useradd -rm -d /home/ubuntu -s /bin/bash -g root -G sudo -u 1000 ubuntu \ | |
&& echo "ubuntu:ubuntu" | chpasswd \ | |
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \ | |
&& service ssh start | |
EXPOSE 22 | |
CMD ["/usr/sbin/sshd", "-D"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment