【Linux】INFO: attempting to log in with the new key(s), to filter out any that are already...

报错内容:
ssh-copy-id master
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: ERROR: ssh: connect to host master port 22: Connection refused

今天用ubuntu18.04版本虚拟机配置SSH免密登陆,创建公钥能成功创建,可是ssh-copy-id拷贝命令一直失败报错,在网上也找了很多方法,比如配置正确的IP映射,修改网络之类的,都没用
在这里插入图片描述
后来我卸载了虚拟机的openssh-client这个服务

sudo apt remove openssh-client

在这里插入图片描述
然后重新下载ssh服务

sudo apt install ssh

在这里插入图片描述
这里面我们可以看到新安装了6个安装包,其中包括了我们之前卸载的openssh-client

安装成功后再次测试,发现已经能成功创建密钥并配置本机免密登录了~
在这里插入图片描述
出现这个报错应该是我刚新建的虚拟机系统缺少了一些ssh服务的安装包,我们直接通过安装所有ssh服务安装包得以解决,如何本篇文章对你有帮助,记得点赞收藏+关注哦

猜你喜欢

转载自blog.csdn.net/beixige/article/details/130296493