1. 程式人生 > >docker 容器開啟ssh服務

docker 容器開啟ssh服務

ssh服務安裝
安裝ssh服務
#yum install openssh-server -y
安裝passwd(修改密碼需要)
#yum install passwd -y
修改sshd_config配置檔案
UsePAM yes改成UsePAM no
關閉主機selinux
當使用passwd修改容器中root密碼的時候,會報錯:
passwd: system_u:system_r:initrc_t:s0 is not authorized to change the password of root
這時候,需要關閉主機selinux。