1.ssh连接错误

  1. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  2. @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
  3. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  4. IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
  5. Someone could be eavesdropping on you right now (man-in-the-middle attack)!
  6. It is also possible that a host key has just been changed.
  7. The fingerprint for the RSA key sent by the remote host is
  8. SHA256:3d0oL+pXTpadNXG2s78HCDc3om8oUI8jLiQkBYmh3NI.
  9. Please contact your system administrator.
  10. Add correct host key in /Users/spectre/.ssh/known_hosts to get rid of this message.
  11. Offending RSA key in /Users/spectre/.ssh/known_hosts:11
  12. RSA host key for 172.17.9.135 has changed and you have requested strict checking.
  13. Host key verification failed.
  14. # 按上述提示进入/Users/spectre/.ssh,然后删除known_hosts里相关主机的rsa信息即可,比如172.17.9.135

2.centos7网络配置

  1. 1.查看当前机器网卡及相关ip配置情况
  2. ip a
  3. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
  4. link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  5. inet 127.0.0.1/8 scope host lo
  6. valid_lft forever preferred_lft forever
  7. inet6 ::1/128 scope host
  8. valid_lft forever preferred_lft forever
  9. 2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
  10. link/ether 08:94:ef:06:69:a8 brd ff:ff:ff:ff:ff:ff
  11. inet 172.17.9.135/24 brd 172.17.9.255 scope global eno1
  12. valid_lft forever preferred_lft forever
  13. inet6 fe80::a94:efff:fe06:69a8/64 scope link
  14. valid_lft forever preferred_lft forever
  15. 3: eno2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
  16. link/ether 08:94:ef:06:69:a9 brd ff:ff:ff:ff:ff:ff
  17. 4: eno3: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
  18. link/ether 08:94:ef:06:69:aa brd ff:ff:ff:ff:ff:ff
  19. 5: eno4: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
  20. link/ether 08:94:ef:06:69:ab brd ff:ff:ff:ff:ff:ff
  21. 6: enp0s20u1u5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
  22. link/ether 0a:94:ef:06:69:af brd ff:ff:ff:ff:ff:ff
  23. # 其中lo是本地回环,一般不用配置,若ping 127.0.0.1能通,则证明网卡没有问题
  24. 2.配置网卡信息,一般我们取第一个,这里是eno1
  25. cd /etc/sysconfig/network-scripts
  26. cp ifcfg-eno1 ifcfg-eno1.bak
  27. vi ifcfg-eno1
  28. # 最终将内容修改如下
  29. TYPE=Ethernet
  30. BOOTPROTO=none
  31. DEFROUTE=yes
  32. PEERDNS=yes
  33. PEERROUTES=yes
  34. IPV4_FAILURE_FATAL=yes
  35. IPV6INIT=no
  36. IPV6_AUTOCONF=yes
  37. IPV6_DEFROUTE=yes
  38. IPV6_PEERDNS=yes
  39. IPV6_PEERROUTES=yes
  40. IPV6_FAILURE_FATAL=no
  41. IPV6_ADDR_GEN_MODE=stable-privacy
  42. NAME=eno1
  43. UUID=b280f4fb-067f-4880-97be-44685cc52f56
  44. DEVICE=eno1
  45. ONBOOT=yes
  46. IPADDR=172.17.9.135
  47. NETMASK=255.255.255.0
  48. GATEWAY=172.17.9.1
  49. 3.重新启动
  50. # 以下三种方式都行
  51. service network restart
  52. /etc/init.d/network restart
  53. systemctl restart network
  54. 4.测试
  55. ping 127.0.0.1,若能ping通,则证明网卡没问题
  56. ping 172.17.9.1,ping网关,能通则证明配置成功
  57. ping 172.17.9.134,ping同一网段的其他地址,重复验证成功性

3.ping异常

  1. ping www.baidu.com
  2. ping:unknown host www.baidu.com
  3. 解决方案:
  4. 1.cp /etc/resolv.conf /etc/resolv.conf.bak
  5. 2.vi /etc/resolv.conf
  6. #将内容修改如下114.114.114.144或8.8.8.8或4.4.4.4
  7. nameserver 114.114.114.114
  8. # 为什么修改成这个地址,请查看https://zhidao.baidu.com/question/304558434158495364.html