privateone commited on
Commit
8b901d1
·
verified ·
1 Parent(s): bd5117d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -18
Dockerfile CHANGED
@@ -5,8 +5,8 @@ FROM ubuntu:focal
5
  ENV DEBIAN_FRONTEND=noninteractive
6
 
7
  # Set timezone to your desired timezone (e.g., "America/New_York")
8
- RUN ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime && \
9
- echo "India/Kolkata" > /etc/timezone
10
 
11
  # Update package list, install required packages, and clean up
12
  RUN apt-get update && \
@@ -56,8 +56,8 @@ RUN useradd -m admin && \
56
  COPY . /app
57
 
58
  # Create necessary directories and set permissions
59
- RUN mkdir -p /var/run/sshd /app /app/users/sshs /app/ssh && \
60
- chmod -R 777 /app
61
  # chmod -R 777 /home/admin/.ssh && \
62
  #cp /app/ssh_config /home/admin/.ssh/config
63
  #touch /etc/sudoers
@@ -73,11 +73,14 @@ RUN mkdir -p /var/run/sshd /app /app/users/sshs /app/ssh && \
73
  # sudo ufw allow 2222/tcp
74
 
75
  #RUN sudo ufw disable
76
-
77
- #RUN rm -f /etc/ssh/ssh_host_* && \
78
- # yes y | ssh-keygen -t rsa -b 2048 -f /etc/ssh/ssh_host_rsa_key -N "" && \
79
- # yes y | ssh-keygen -t ecdsa -b 256 -f /etc/ssh/ssh_host_ecdsa_key -N "" && \
80
- # yes y | ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N ""
 
 
 
81
 
82
 
83
  # Secure SSH Configuration
@@ -91,23 +94,21 @@ RUN mkdir -p /var/run/sshd /app /app/users/sshs /app/ssh && \
91
  # echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config && \
92
  # echo "AuthorizedKeysFile .ssh/authorized_keys" >> /etc/ssh/sshd_config && \
93
 
94
- RUN cp /app/sshd_config /etc/ssh/sshd_config && \
95
- cat /etc/ssh/sshd_config
96
 
97
 
98
  # Copy all the contents of /etc/ssh to /app/ssh
99
- RUN mkdir -p /app/ssh && cp -r /etc/ssh/* /app/ssh
100
 
101
 
102
  # Set the permissions for the SSH keys
103
- RUN chmod 777 /etc/ssh/ssh_* && \
104
- touch /app/ssh/ssh_known_hosts && \
105
- chmod 777 /app/ssh/ssh_* && \
106
- chmod 777 /home
107
 
108
  # List contents of /etc/ssh and /app/ssh
109
- RUN ls -l /etc/ssh/ && \
110
- ls -l /app/ssh/
111
 
112
  # Install WebSSH
113
  RUN python3 -m venv /app/WebSSHEnv && \
 
5
  ENV DEBIAN_FRONTEND=noninteractive
6
 
7
  # Set timezone to your desired timezone (e.g., "America/New_York")
8
+ #RUN ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime && \
9
+ # echo "India/Kolkata" > /etc/timezone
10
 
11
  # Update package list, install required packages, and clean up
12
  RUN apt-get update && \
 
56
  COPY . /app
57
 
58
  # Create necessary directories and set permissions
59
+ #RUN mkdir -p /var/run/sshd /app /app/users/sshs /app/ssh && \
60
+ # chmod -R 777 /app
61
  # chmod -R 777 /home/admin/.ssh && \
62
  #cp /app/ssh_config /home/admin/.ssh/config
63
  #touch /etc/sudoers
 
73
  # sudo ufw allow 2222/tcp
74
 
75
  #RUN sudo ufw disable
76
+ RUN cp /app/sshd_config /etc/ssh/sshd_config && \
77
+ cat /etc/ssh/sshd_config
78
+
79
+ RUN rm -f /etc/ssh/ssh_* && \
80
+ yes y | ssh-keygen -t rsa -b 2048 -f /etc/ssh/ssh_host_rsa_key -N "0Ne" && \
81
+ yes y | ssh-keygen -t ecdsa -b 256 -f /etc/ssh/ssh_host_ecdsa_key -N "0Ne" && \
82
+ yes y | ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N "0Ne"
83
+ ssh-keyscan -p 2222 0.0.0.0 >> /etc/ssh/ssh_known_hosts
84
 
85
 
86
  # Secure SSH Configuration
 
94
  # echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config && \
95
  # echo "AuthorizedKeysFile .ssh/authorized_keys" >> /etc/ssh/sshd_config && \
96
 
 
 
97
 
98
 
99
  # Copy all the contents of /etc/ssh to /app/ssh
100
+ #RUN mkdir -p /app/ssh && cp -r /etc/ssh/* /app/ssh
101
 
102
 
103
  # Set the permissions for the SSH keys
104
+ #RUN chmod 777 /etc/ssh/ssh_* && \
105
+ # touch /app/ssh/ssh_known_hosts && \
106
+ # chmod 777 /app/ssh/ssh_* && \
107
+ # chmod 777 /home
108
 
109
  # List contents of /etc/ssh and /app/ssh
110
+ RUN ls -l /etc/ssh/
111
+ # && ls -l /app/ssh/
112
 
113
  # Install WebSSH
114
  RUN python3 -m venv /app/WebSSHEnv && \