enemy7 commited on
Commit
2f69fcd
·
1 Parent(s): ecc023c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -11
Dockerfile CHANGED
@@ -17,20 +17,20 @@
17
 
18
  # CMD ["docker-compose up"]
19
 
20
-
21
  FROM ubuntu:latest
22
 
23
- RUN apt update && apt install openssh-server sudo -y
24
-
25
- RUN useradd -rm -d /home/ubuntu -s /bin/bash -g root -G sudo -u 1000 test
26
-
27
- RUN echo 'test:test' | chpasswd
28
- RUN ssh-keygen -A
29
-
30
- RUN service ssh start
31
 
 
 
32
 
 
 
33
 
34
- EXPOSE 22
 
35
 
36
- CMD ["/usr/sbin/sshd","-D"]
 
 
17
 
18
  # CMD ["docker-compose up"]
19
 
20
+ # Use a base image with an SSH server (you can choose a specific image based on your requirements)
21
  FROM ubuntu:latest
22
 
23
+ # Update the package lists and install the SSH server
24
+ RUN apt-get update && apt-get install -y openssh-server
 
 
 
 
 
 
25
 
26
+ # Create an SSH user (replace "sshuser" with your desired username)
27
+ RUN useradd -m -d /home/sshuser -s /bin/bash sshuser
28
 
29
+ # Set a password for the SSH user (replace "sshpassword" with your desired password)
30
+ RUN echo 'sshuser:sshpassword' | chpasswd
31
 
32
+ # Expose port 7768 for SSH
33
+ EXPOSE 7768
34
 
35
+ # Start the SSH server when the container runs
36
+ CMD ["/usr/sbin/sshd", "-D"]