原因
生產機器默認禁用了ssh密碼登錄權限。
解決方案一,sshkey
主機一:
ssh-keygen -t rsa
將生產的pub文件拷貝到主機二上
主機二:
root@spark3:~# cat 1.pub >> .ssh/authorized_keys
root@spark3:~# chmod 600 .ssh/authorized_keys
root@spark3:~# chmod 700 .ssh
解決方案二,允許ssh密碼登錄權限
- 登錄目標機器 打開 /etc/ssh/sshd_config ,修改PasswordAuthentication no 為:
PasswordAuthentication yes
- 重啟服務
/etc/init.d/sshd restart