Docker 中打开SSH

安装和启动openssh服务

/etc/init.d/ssh start

 

ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key

echo 'root:yourpasswd' | chpasswd //设置root密码

vi /etc/ssh/sshd_config
将PermitRootLogin 改为 yes,将 UsePAM 改为 no。

重启服务:

/etc/init.d/ssh restart

posted on 2022-04-01 18:22  arrow8209  阅读(108)  评论(0)    收藏  举报

导航