windows 10 vmare 安装centos 需要的问题

一. yum 不能使用的问题

1.1 yum --help 会发现提示yum已经正确安装。

在这里插入图片描述

1.2 找到配置文件 ifcfg-ens33

进入配置文件目录

cd /etc/sysconfig/network-scripts

查看目录文件

ls

找到网卡配置文件 “ifcfg-ens33” 对此文件进行编辑

在这里插入图片描述

1.3 找到网卡配置文件 “ifcfg-ens33” 对此文件进行编辑

vi ifcfg-ens33

输入i切换插入模式找到 ONBOOT 这一项,并将其参数由 NO 改为 YES esc :wq 保存修改并退出

1.4 重启虚拟机

输入reboot重启虚拟机

二 . CentOS7安装后无法使用鼠标选中,复制问题解决

出现这种情况,一般是没有安装linux的鼠标服务器gpm

gpm命令 是Linux的虚拟控制台下的鼠标服务器,用于在虚拟控制台下实现鼠标复制和粘贴文本的功能。

具体操作:

运行命令:yum install gpm* 安装gpm

启动gpm服务:
service gpm start

运行systemctl enable gpm.servicere 添加到后台服务。

三. 安装netstat

yum install net-tools

四. 开启SSH

  • 要确保centos7安装了openssh-server,在终端输入yum list installed | grep openssh-server
[root@localhost hjw]# yum list installed |grep openssh-server

我这显示已经安装了,如果没有输出显示表明没有安装,通过输入yum install openssh-server进行安装。

[root@localhost hjw]# yum install openssh-server
  • .安装好后,使用vim打开/etc/ssh/下面的sshd_config文件进行更改
[root@localhost hjw]# vi /etc/ssh/sshd_config
.........
........
Port 22          #将改行前面的#键去掉,开启22端口
#AddressFamily any
ListenAddress 0.0.0.0 #将改行前面的#键去掉
ListenAddress ::      #将改行前面的#键去掉
.......
.........
#LoginGraceTime 2m
PermitRootLogin yes         #将改行前面的#键去掉  允许远程登录
#StrictModes yes
...........
..............
#PasswordAuthentication yes
#PermitEmptyPasswords no
PasswordAuthentication yes     #将改行前面的#键去掉,这是开启用户名和密码登录

保存文件后退出

  • 编辑完后要开启sshd服务,输入sudo service sshd start
[root@localhost hjw]# sudo service sshd start
Redirecting to /bin/systemctl start sshd.service
  • 检查22端口是否开通,输入命令netstat -an | grep 22
[root@localhost hjw]# netstat -an| grep 22
tcp        0      0 192.168.122.1:53        0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN  

表明已经开通,可以根据ip地址进行远程连接,使用ifconfig命令获取ip地址

猜你喜欢

转载自blog.csdn.net/jinian2016/article/details/113111325