File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323
2424RUN \
2525 /usr/bin/ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
26- echo 'root:Hello1234' | chpasswd && \
2726 groupadd -r admin && useradd -g admin admin && \
2827 yum install -y man && \
2928 yum install -y dstat && \
3938 ssh-keygen -q -N "" -t rsa -f /etc/ssh/ssh_host_rsa_key && \
4039 sed -ri 's/session required pam_loginuid.so/#session required pam_loginuid.so/g' /etc/pam.d/sshd && \
4140 sed -i -e 's/^#Port 22$/Port 2222/' /etc/ssh/sshd_config && \
41+ sed -i 's/^#\? PermitRootLogin.*/PermitRootLogin prohibit-password/' /etc/ssh/sshd_config && \
42+ sed -i 's/^#\? PasswordAuthentication.*/PasswordAuthentication no/' /etc/ssh/sshd_config && \
4243 mkdir -p /root/.ssh && chown root.root /root && chmod 700 /root/.ssh && \
4344 yum install -y cronie && \
4445 sed -i '/session required pam_loginuid.so/d' /etc/pam.d/crond && \
Original file line number Diff line number Diff line change 2323
2424RUN \
2525 /usr/bin/ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
26- echo 'root:Hello1234' | chpasswd && \
2726 groupadd -r admin && useradd -g admin admin && \
2827 yum install -y man && \
2928 yum install -y dstat && \
3938 ssh-keygen -q -N "" -t rsa -f /etc/ssh/ssh_host_rsa_key && \
4039 sed -ri 's/session required pam_loginuid.so/#session required pam_loginuid.so/g' /etc/pam.d/sshd && \
4140 sed -i -e 's/^#Port 22$/Port 2222/' /etc/ssh/sshd_config && \
41+ sed -i 's/^#\? PermitRootLogin.*/PermitRootLogin prohibit-password/' /etc/ssh/sshd_config && \
42+ sed -i 's/^#\? PasswordAuthentication.*/PasswordAuthentication no/' /etc/ssh/sshd_config && \
4243 mkdir -p /root/.ssh && chown root.root /root && chmod 700 /root/.ssh && \
4344 yum install -y cronie && \
4445 sed -i '/session required pam_loginuid.so/d' /etc/pam.d/crond && \
You can’t perform that action at this time.
0 commit comments