privateone commited on
Commit
be3c488
·
verified ·
1 Parent(s): b93344d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -14
Dockerfile CHANGED
@@ -69,19 +69,11 @@ RUN sed -i 's/Defaults !requiretty/Defaults requiretty/' /etc/sudoers && \
69
  #RUN ssh-keygen -A &&\
70
  # sudo ufw allow 2222/tcp
71
 
72
- # Generate SSH keys
73
- #RUN ssh-keygen -t rsa -b 2048 -f /etc/ssh/ssh_host_rsa_key && \
74
- # ssh-keygen -t ecdsa -b 256 -f /etc/ssh/ssh_host_ecdsa_key && \
75
- # ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key
76
-
77
- #RUN ssh-keygen -q -t rsa -b 2048 -f /etc/ssh/ssh_host_rsa_key -N "" -y && \
78
- # ssh-keygen -q -t ecdsa -b 256 -f /etc/ssh/ssh_host_ecdsa_key -N "" -y && \
79
- # ssh-keygen -q -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N "" -y
80
-
81
- RUN rm -f /etc/ssh/ssh_host_* && \
82
- yes y | ssh-keygen -t rsa -b 2048 -f /etc/ssh/ssh_host_rsa_key -N "" && \
83
- yes y | ssh-keygen -t ecdsa -b 256 -f /etc/ssh/ssh_host_ecdsa_key -N "" && \
84
- yes y | ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N ""
85
 
86
 
87
  # Secure SSH Configuration
@@ -90,7 +82,7 @@ RUN sed -i 's/#PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config &&
90
  sed -i 's/#ChallengeResponseAuthentication yes/ChallengeResponseAuthentication no/' /etc/ssh/sshd_config && \
91
  sed -i 's/#UsePAM yes/UsePAM no/' /etc/ssh/sshd_config && \
92
  sed -i 's/#Port 22/Port 2222/' /etc/ssh/sshd_config && \
93
- echo "AllowUsers admin" >> /etc/ssh/sshd_config && \
94
  echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config && \
95
  echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config && \
96
  echo "AuthorizedKeysFile .ssh/authorized_keys" >> /etc/ssh/sshd_config
 
69
  #RUN ssh-keygen -A &&\
70
  # sudo ufw allow 2222/tcp
71
 
72
+
73
+ #RUN rm -f /etc/ssh/ssh_host_* && \
74
+ # yes y | ssh-keygen -t rsa -b 2048 -f /etc/ssh/ssh_host_rsa_key -N "" && \
75
+ # yes y | ssh-keygen -t ecdsa -b 256 -f /etc/ssh/ssh_host_ecdsa_key -N "" && \
76
+ # yes y | ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N ""
 
 
 
 
 
 
 
 
77
 
78
 
79
  # Secure SSH Configuration
 
82
  sed -i 's/#ChallengeResponseAuthentication yes/ChallengeResponseAuthentication no/' /etc/ssh/sshd_config && \
83
  sed -i 's/#UsePAM yes/UsePAM no/' /etc/ssh/sshd_config && \
84
  sed -i 's/#Port 22/Port 2222/' /etc/ssh/sshd_config && \
85
+ echo "AllowUsers *" >> /etc/ssh/sshd_config && \
86
  echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config && \
87
  echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config && \
88
  echo "AuthorizedKeysFile .ssh/authorized_keys" >> /etc/ssh/sshd_config