下载

Centos-7-x86_64的镜像文件
http://mirrors.aliyun.com/centos/7/isos/x86_64/

VMware

https://zhuanlan.zhihu.com/p/115931121
https://blog.csdn.net/qq_39135287/article/details/83993574

网络设置

三种连接方式区别:https://www.cnblogs.com/aeolian/p/8882790.html https://blog.csdn.net/AloneCoding/article/details/106809384 https://blog.csdn.net/u010486658/article/details/70871940 https://blog.csdn.net/q290994/article/details/61643500 https://blog.csdn.net/lvtula/article/details/82016884

image.png

  1. IPADDR地址需要根据创建虚拟机时选择的网卡模式来配置
  2. 如果是桥接模式,就根据你自己路由器的IP网段来设置,一般跟物理机网段相同就行
  3. 如果是NAT模式需要在VMware主界面选择编辑==>虚拟网络编辑器==>NAT模式来查看IP网段
    1. cd /etc/sysconfig/network-scripts/
    2. vi ifcfg-ens33
    image.png
    #保存退出后使用命令重启网络服务
    systemctl restart network.service
    service network restart
    输入systemctl restart network 重启虚拟机网络
    输入systemctl stop firewalld 关闭防火墙
    输入systemctl disable firewalld 移除防火墙
    image.png
    然后试着虚拟机ping www.baidu.com
    windows内ping 192.168.127.100

    ssh 连接

    安装后配置

    http://www.manongjc.com/detail/14-ssltadrcyilbkal.html

配置yum源

  1. curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
  2. wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
  1. [root@centos7 ~]# cat /etc/yum.repos.d/CentOS-Base.repo
  2. # CentOS-Base.repo
  3. #
  4. # The mirror system uses the connecting IP address of the client and the
  5. # update status of each mirror to pick mirrors that are updated to and
  6. # geographically close to the client. You should use this for CentOS updates
  7. # unless you are manually picking other mirrors.
  8. #
  9. # If the mirrorlist= does not work for you, as a fall back you can try the
  10. # remarked out baseurl= line instead.
  11. #
  12. #
  13. [base]
  14. name=CentOS-$releasever - Base - mirrors.aliyun.com
  15. failovermethod=priority
  16. baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
  17. http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/
  18. http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
  19. gpgcheck=1
  20. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
  21. #released updates
  22. [updates]
  23. name=CentOS-$releasever - Updates - mirrors.aliyun.com
  24. failovermethod=priority
  25. baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
  26. http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/
  27. http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
  28. gpgcheck=1
  29. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
  30. #additional packages that may be useful
  31. [extras]
  32. name=CentOS-$releasever - Extras - mirrors.aliyun.com
  33. failovermethod=priority
  34. baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
  35. http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/
  36. http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/
  37. gpgcheck=1
  38. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
  39. #additional packages that extend functionality of existing packages
  40. [centosplus]
  41. name=CentOS-$releasever - Plus - mirrors.aliyun.com
  42. failovermethod=priority
  43. baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/
  44. http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/
  45. http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/
  46. gpgcheck=1
  47. enabled=0
  48. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
  49. #contrib - packages by Centos Users
  50. [contrib]
  51. name=CentOS-$releasever - Contrib - mirrors.aliyun.com
  52. failovermethod=priority
  53. baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/
  54. http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/
  55. http://mirrors.cloud.aliyuncs.com/centos/$releasever/contrib/$basearch/
  56. gpgcheck=1
  57. enabled=0
  58. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
  1. [root@centos7 ~]# cat /etc/yum.repos.d/epel.repo
  2. [epel]
  3. name=Extra Packages for Enterprise Linux 7 - $basearch
  4. baseurl=http://mirrors.aliyun.com/epel/7/$basearch
  5. failovermethod=priority
  6. enabled=1
  7. gpgcheck=0
  8. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
  9. [epel-debuginfo]
  10. name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
  11. baseurl=http://mirrors.aliyun.com/epel/7/$basearch/debug
  12. failovermethod=priority
  13. enabled=0
  14. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
  15. gpgcheck=0
  16. [epel-source]
  17. name=Extra Packages for Enterprise Linux 7 - $basearch - Source
  18. baseurl=http://mirrors.aliyun.com/epel/7/SRPMS
  19. failovermethod=priority
  20. enabled=0
  21. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
  22. gpgcheck=0

安装必要的软件包

  1. yum install bash-completion
  2. yum install -y vim tree telnet nc nmap net-tools wget bash-completion lrzsz chrony bc net-tools

设置快速远程连接

  1. [root@centos71 ~]# cat /etc/ssh/sshd_config | grep -i "dns"
  2. UseDNS no
  3. [root@centos71 ~]# cat /etc/ssh/sshd_config | grep -i "GSSAPIauth"
  4. GSSAPIAuthentication no