Practice OS-1: Configuration Environment - Installation and Configuration CentOS SSH

Zero, mirroring ready

  1, CentOS mirror.centos.org mirrored to download -> download download bt Thunder

 

  2, it is worth mentioning that there are two 6.10 DVD, in "0 README.txt" see the need to load the installation 6.10 DVD1

 

 

  3, download Virtualbox   6.1, the next step has been installed just fine

 

 

 

A, virtualbox install CentOS

  1, click New to create open virtualbox centos 6.10, select the version of Red Hat on the line (click on Next will be recorded in the second column more than a "CentOS_64bit" folder)

 

 

 

   2, my memory is 8G, so assign 1G on the line

 

 

  3, the virtual hard disk must have, so choose the second column, "Now create a virtual hard disk"

 

 

  4, due to the virtual hard disk format I use virtualbox so the election of the first column of VDI

 

 

  5, hard disk size, I chose to "dynamic" in the first column, dynamic and fixed difference is one is what you use to create, and the other is to use more quickly

 

 

   6, set the maximum size of the hard drive, like the default 8GB

 

 

  7, after this step will return to virtualbox main interface, then click CentOS_64bit we just created click Start

 

 

   8, like the beginning that only need to select the DVD1 on the line

 

   9, by selecting the second column "graphics driver installation"

 

Install or upgrade an existing system to install or upgrade an existing system

install system with basic video driver installation process using the basic graphics driver

Rescue installed system into the system repair mode

Boot from local drive to exit the installation from the hard drive

Memory test Memory test

 

   10, immediately skip check the installation

 

 

 

   11, choose the language of personal preferences

 

 

  12, like the US style keyboard

 

   13, the default option "Basic Storage Device"

 

   14, empty virtual disk data

 

 

   15、网络最后再设置,在主界面用host-only就好所以这里直接下一步

 

 

   16、时区选了上海

 

 

   17、设置root用户,但由于我设的密码比较简单所以会有个提示,我这里选“无论怎样都使用”

 

   18、磁盘分区我们自定义分区

 

 

   19、点创建->标准即可

 

 

   20、交换分区swap,设置大小有说1.5~2倍内存大小的,不过我对这个没什么了解,由于上面硬盘大小最大8GB,所以这里设了2GB

 

 

   21、把剩余的空间全部分配给根分区,根分区会创建其他分区的了

 

 

 

   22、上几步的设置完成后,基本信息如下

 

 

   23、格式化各分区在创建

 

 

  24、 把刚才的分区更改信息写入磁盘

 

 

   25、设置bootloader,默认即可

 

 

   26、默认安装的软件,图形界面选Desktop就好了,底下的选稍后自定义安装

 

 

   27、到这个界面等待安装完成即可

 

 

   28、一段时间以后安装完成,点击重启

 

 

   29、首次启动会有一些基本设置

 

 

   30、同意版权

 

 

   31、Root用户是最高特权的用户,所以平时使用可以用一个普通特权的用户

 

 

   32、有网络环境可以勾选这个复选框

 

 

   33、这里提示内存不足所以配置不了kdump,kdump是分析系统崩溃方面的东西,一般也很少用,所以点ok就行

 

 

 

   34、登录到CentOS

 

 

  安装结束

 

 

 

 二、设置远程登录 

  1、先关机在virtualbox主界面点击设置(这里我设置了两个网络端口,一个NAT一个host-only。因为我在测试的时候发现宿主主机和虚拟机主机不能互ping,只有设置了host-only才能互ping,这样才能使用ssh远程连接到虚拟机的centos)。我这里先设置NAT,为了使用ssh对此虚拟机进行远程操作,点开“高级”->“端口转发规则”

 

 

   2、端口随便设置就好,不过一般centos默认的ssh端口是22,所以我这里设置成了22懒得改里面的配置了,至于主机端口是指我“外面的”Windows宿主主机

 

 

   3、再设置"host-only",在“适配器2”这里点击使用的复选框

 

  设置完后点击“启动”

 

  4、输入“ps -ef | grep ssh”如果看到类似我这的内容证明ssh服务已经开启了

 

 

   5、查看ssh配置文件的端口,有需要的话可以修改

 

 

   6、可以看到配置文件中默认ssh端口为22,这里就不修改了

 

   7、打开ssh客户端,任意一个即可,我这里用的是termius(Windows自带的Microsoft Store就有)

 

 

   8、这样就连接到虚拟机的centos了,以后用ssh操作就方便得多,不过有些软件还是需要用GUI否则启动不了,不过这个以后用到再切回虚拟机就好了

 

 

Guess you like

Origin www.cnblogs.com/bEngi1/p/12346659.html