虚拟机debian9上实现ssh到虚拟机centos7,关键步骤是需要把debain9的公钥/root/.ssh/ id_rsa.pub复制到centos上的/root/.ssh/authorized_keys里,之后可以在debian9上使用ssh root@192.168.65.128 -p 22
免密切换到centos7。
具体步骤:
1.在跳板机debian9下/root/.ssh配置config文件:
vi config
ControlMaster auto
ControlPath /tmp/ssh_mux_%h_%p_%r ##这个字段是否限定了只能root登录,无法使用zrj登录?###不是,操作错误,一般用户登录需要指定对应私钥去登录,同时需要目的机器设置好.sss目录下的权限。
ControlPersist 1h
StrictHostKeyChecking no
SendEnv LANG LC_*
GSSAPIAuthentication no
GSSAPIDelegateCredentials no