2, also tried by weave, but SSH to the container of IP, is to enter the host machine,
Please friends help solve,
CodePudding user response:
Your SSH docker container port is not mapped to the host machine, you open a port mapping to the docker port 22CodePudding user response:
Should be SSH and PAM set problemsAdd in Dockerfile
RUN SSH - the keygen - q - N "" -t rsa -f/etc/SSH/ssh_host_rsa_key; \build again mirror
SSH - the keygen - q - N "" -t ecdsa -f/etc/SSH/ssh_host_ecdsa_hey; \
SSH - the keygen - q - N "" -t dsa -f/etc/SSH/ssh_host_ed25519_key; \
Sed -i "s/^ \ \ s * (session + required \ \ s \ \ s + pam_loginuid \. So \)/# \ 1/g"/etc/PAM. D/SSHD; \
Sed -i "/^ \ s * # PermitRootLogin \ s * */aPermitRootLogin yes"/etc/SSH/sshd_config; \
Echo 'root: admin123 | chpasswd