Operating Environment
Docker
Centos7
Problem Description
After the new CentOS 7 container,sshd process starts in Docker, the container is connected through the Docker host SSH, prompting for information:
[Root@centos-cloudera-1 ~]# ssh 10.10.200.4 the
authenticity of host ' 10.10.200.4 (10.10.200.4) ' can ' t be established .
ECDSA key fingerprint is sha256:xn2tjx3zw88qjdbirg7a1k39jyyvcz2vd13iiehp2p0.
ECDSA key fingerprint is md5:1d:76:e4:ec:59:70:8c:7d:da:4b:e9:d7:f2:d0:4b:47.
Are you sure your want to continue connecting (yes/no)? Yes
warning:permanently added ' 10.10.200.4 ' (ECDSA) to the list of known hosts.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
Solving Method
1. Remove the existing Openssh-server by Yum and reinstall Openssh-server
#yum-y Remove openssh-server
#yum-y install Openssh-server
2. Set Key #
#sshd-keygen
3. Modify the Pubkeyauthentication option in the Sshd_config configuration file to set this option to Yes
Pubkeyauthentication Yes
4. Start sshd
#/usr/sbin/sshd
5. Connect the container through another server
[Root@centos-cloudera-1 ~]# ssh 10.10.200.4