1.ssh连接错误
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:3d0oL+pXTpadNXG2s78HCDc3om8oUI8jLiQkBYmh3NI.
Please contact your system administrator.
Add correct host key in /Users/spectre/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/spectre/.ssh/known_hosts:11
RSA host key for 172.17.9.135 has changed and you have requested strict checking.
Host key verification failed.
# 按上述提示进入/Users/spectre/.ssh,然后删除known_hosts里相关主机的rsa信息即可,比如172.17.9.135
2.centos7网络配置
1.查看当前机器网卡及相关ip配置情况
ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 08:94:ef:06:69:a8 brd ff:ff:ff:ff:ff:ff
inet 172.17.9.135/24 brd 172.17.9.255 scope global eno1
valid_lft forever preferred_lft forever
inet6 fe80::a94:efff:fe06:69a8/64 scope link
valid_lft forever preferred_lft forever
3: eno2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
link/ether 08:94:ef:06:69:a9 brd ff:ff:ff:ff:ff:ff
4: eno3: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
link/ether 08:94:ef:06:69:aa brd ff:ff:ff:ff:ff:ff
5: eno4: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
link/ether 08:94:ef:06:69:ab brd ff:ff:ff:ff:ff:ff
6: enp0s20u1u5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
link/ether 0a:94:ef:06:69:af brd ff:ff:ff:ff:ff:ff
# 其中lo是本地回环,一般不用配置,若ping 127.0.0.1能通,则证明网卡没有问题
2.配置网卡信息,一般我们取第一个,这里是eno1
cd /etc/sysconfig/network-scripts
cp ifcfg-eno1 ifcfg-eno1.bak
vi ifcfg-eno1
# 最终将内容修改如下
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=eno1
UUID=b280f4fb-067f-4880-97be-44685cc52f56
DEVICE=eno1
ONBOOT=yes
IPADDR=172.17.9.135
NETMASK=255.255.255.0
GATEWAY=172.17.9.1
3.重新启动
# 以下三种方式都行
service network restart
/etc/init.d/network restart
systemctl restart network
4.测试
ping 127.0.0.1,若能ping通,则证明网卡没问题
ping 172.17.9.1,ping网关,能通则证明配置成功
ping 172.17.9.134,ping同一网段的其他地址,重复验证成功性
3.ping异常
ping www.baidu.com
ping:unknown host www.baidu.com
解决方案:
1.cp /etc/resolv.conf /etc/resolv.conf.bak
2.vi /etc/resolv.conf
#将内容修改如下114.114.114.144或8.8.8.8或4.4.4.4
nameserver 114.114.114.114
# 为什么修改成这个地址,请查看https://zhidao.baidu.com/question/304558434158495364.html