配置docker容器上ssh无密登录
1、修改所有容器中root账户密码
ssh到远程主机时,首次需要密码访问,因此需要修改root账号密码。 密码必须要8位以上字母数字混合。
$>passwd
2、在spark30容器生成公私秘钥对
$>ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
3、在spark30使用ssh-copy-id复制公钥到远程主机
# 复制公钥到spark容器
$>ssh-copy-id root@192.168.231.31
$>ssh-copy-id root@192.168.231.40
$>ssh-copy-id root@192.168.231.41
4、测试ssh是否ok
$>ssh 192.168.231.31
$>ssh 192.168.231.40
$>ssh 192.168.231.41