在SSH配置中,会出现ssh-copy-id -i /root/.ssh/id_dsa.pub [email protected] refused

ssh-copy-id -i ~/.ssh/id_dsa.pub root@172.16.1.41
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: “/root/.ssh/id_dsa.pub”
/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 172.16.1.41 port 22: Connection refused

一开始以为是ssh的问题,一直在研究ssh的连接问题,发现一直检查也没有解决。
突然使用 ip a 发现
ens37: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:a7:26:c8 brd ff:ff:ff:ff:ff:ff
inet6 fe80::4687:125a:487a:d3f1/64 scope link noprefixroute
valid_lft forever preferred_lft forever

有一块网卡出现了问题,修改完网卡配置后,就成功了。
(修改网卡方式为:更改配置文件中的HWADDR的设置)

ssh-copy-id -i /root/.ssh/id_dsa.pub root@172.16.1.41
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: “/root/.ssh/id_dsa.pub”
The authenticity of host ‘172.16.1.41 (172.16.1.41)’ can’t be established.
ECDSA key fingerprint is SHA256:CITDEPi+EV4tbIok4PPGYZ6of8VT9T86tERwSTL/rPM.
ECDSA key fingerprint is MD5:91:9c:18:03:1b:cb:74:04:94:ff:c5:f2:5a:a8:b6:95.
Are you sure you want to continue connecting (yes/no)? yes
/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: INFO: 1 key(s) remain to be installed – if you are prompted now it is to install the new keys
root@172.16.1.41’s password:

Number of key(s) added: 1

Now try logging into the machine, with: “ssh ‘root@172.16.1.41’”
and check to make sure that only the key(s) you wanted were added.

成功!!

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值