BinaryONe commited on
Commit
2f12044
·
1 Parent(s): 15c2e29
Files changed (2) hide show
  1. Dockerfile +13 -6
  2. WebSSH/requirements.txt +2 -1
Dockerfile CHANGED
@@ -27,12 +27,14 @@ RUN apt-get update && \
27
  # usermod -aG administrator,sudo ubuntu
28
 
29
  # Create the 'admin' and 'ubuntu' users with home directories and passwords, and add them to the 'sudo' group
30
- RUN useradd -m admin && \
31
- echo 'admin:password' | chpasswd && \
32
- echo 'ubuntu:password' | chpasswd && \
33
- usermod -aG sudo admin && \
34
- usermod -aG sudo ubuntu
35
 
 
 
 
 
36
 
37
  # Copy the application code to the container
38
  COPY . /app
@@ -97,10 +99,15 @@ EXPOSE 7860 2222
97
  #WORKDIR /home/admin
98
  # Change ownership of /home/admin directory
99
  #RUN chown -R admin:admin /home/admin
 
 
 
 
 
100
 
101
  RUN chmod -R 777 /app /home
102
 
103
- USER admin
104
 
105
  # Default command to keep the container running
106
  CMD ["/bin/bash","-c","/usr/sbin/sshd -p 2222 && /app/start.sh"]
 
27
  # usermod -aG administrator,sudo ubuntu
28
 
29
  # Create the 'admin' and 'ubuntu' users with home directories and passwords, and add them to the 'sudo' group
30
+ #RUN groupadd -r admin && useradd -r -g users admin && \
31
+ # echo 'admin:password' | chpasswd && \
32
+ # echo 'ubuntu:password' | chpasswd && \
 
 
33
 
34
+ RUN groupadd -r admin && useradd -r -g admin -G sudo -m -s /bin/bash admin && \
35
+ usermod -aG sudo admin && \
36
+ echo "admin:password" | chpasswd && \
37
+ echo "admin ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
38
 
39
  # Copy the application code to the container
40
  COPY . /app
 
99
  #WORKDIR /home/admin
100
  # Change ownership of /home/admin directory
101
  #RUN chown -R admin:admin /home/admin
102
+ RUN cat /etc/passwd && \
103
+ cat /etc/group && \
104
+ cat /etc/sudoers && \
105
+ cat /etc/shadow
106
+
107
 
108
  RUN chmod -R 777 /app /home
109
 
110
+ #USER admin
111
 
112
  # Default command to keep the container running
113
  CMD ["/bin/bash","-c","/usr/sbin/sshd -p 2222 && /app/start.sh"]
WebSSH/requirements.txt CHANGED
@@ -2,4 +2,5 @@ tornado
2
  webssh
3
  paramiko
4
  Jinja2
5
- logging
 
 
2
  webssh
3
  paramiko
4
  Jinja2
5
+ logging
6
+ fakesudo