Docker容器ssh

apt install openssh-server
vim /etc/ssh/sshd_config

Port 22
PermitRootLogin yes #root登录
/etc/init.d/ssh start

出现错误

# service ssh start
 * Starting OpenBSD Secure Shell server sshd
sshd: no hostkeys available -- exiting.

解决办法

ssh-keygen -A
posted @ 2022-12-06 13:53  thomas_blog  阅读(17)  评论(0编辑  收藏  举报