891人加入学习
(2人评价)
Linux网络操作系统常见服务的安装与配置

基于VMWARE15和红帽7Linux(RHEL7)

价格 免费

一。防火墙操作

1.在之前的版本(Redhat7以前命令:

关闭防火墙等服务的命令是

service iptables stop

2.RHEL7中新命令

其实没有这个服务,在RHEL7开始,使用systemctl工具来管理服务程序,包括了servicechkconfig

 

[root@localhost test]# systemctl list-unit-files| grep fire

firewalld.service                           enabled

 

启动一个服务:systemctl start firewalld.service

关闭一个服务:systemctl stop firewalld.service

重启一个服务:systemctl restart firewalld.service

显示一个服务的状态:systemctl status firewalld.service

在开机时启用一个服务:systemctl enable firewalld.service

在开机时禁用一个服务:systemctl disable firewalld.service

查看服务是否开机启动:systemctl is-enabled firewalld.service;echo $?

查看已启动的服务列表:systemctl list-unit-files|grep enabled

 

二。ssh服务器

1.查看服务状态

systemctl status sshd

2.安装服务器

这是网络操作系统最重要的服务。
安装后检查
[root@localhost test]# rpm -qa| grep ssh
openssh-clients-6.6.1p1-22.el7.x86_64
openssh-server-6.6.1p1-22.el7.x86_64
libssh2-1.4.3-10.el7.x86_64
openssh-6.6.1p1-22.el7.x86_64

安装的话一定安装64位的,即带.x86_64后缀的

3.启动服务器

检查服务是否已经安装

[root@localhost test]# systemctl list-unit-files |grep sshd

sshd.service  enabled(表示服务器已开启)

 

systemctl stop sshd.service    redhat7版本命令

systemctl start sshd.service

systemctl restart sshd.service

3.配置服务器

systemctl disable sshd.service   禁止开机启动

systemctl enable sshd.service   开机启动

 

配置文件位置

/etc/ssh/sshd_config

Port 22  登录端口

PermitRootLogin yes   是否允许root登录

[展开全文]

1.设置网卡开机激活

进入到/etc/sysconfig/network-scripts目录下将ifcfg-***(我的是ifcfg-eno16777736)里面的ONBOOT设置为no,重启后网卡就被禁用了。通过如下命令可以开启和禁用网卡。

2.进入vim

在终端输入:vim ifcfg-eno16777736

3.退出vim

在vim输入: :q

4.复制网络配置文件并命名为myifcfg

cp ifcfg-eno16777736 myifcfg

4.在vim修改文本

在vim输入i,进入插入模式

按ese,退出插入模式

默认模式下,x键相当于backspace

5.保存并退出vim

:wq

 

 

先在UI界面将IP配置为手动形式,然后备份一下配置,再在原配置文件通过vim修改成自动获取,最后验证。

[展开全文]

一.界面设置IP

1.虚拟机网络设置为:桥接模式:直接连接物理网络。(不勾选复制物理网络连接状态)

2.如果开启了Hyper-v,会导致IP与Hyper-v网段一致,所以应关闭Hyper-v服务。

3.设置固定IP,添加配置->IPv4->自动(DHCP)改为手动->设置地址、网络掩码、网关=服务器。

4.认证名称为“固定IP”,在有线配置列表内选择它。

二。打开简易界面配置网络

nmtui

三。使用nmcli命令

查看所有网卡

nmcli device status

 

激活网卡的配置(有多个IP配置时,down关闭会失败)

nmcli connection up 设备

例如:nmcli connection down eno16777736 关闭网卡

 

激活网卡 ifup enoxxxx

禁止网卡 ifdown enoxxxxx

[展开全文]

1.启动/停止/重启服务

systemctl start xxxx

systemctl stop xxxx

2.服务设置为开机启动/取消开机启动

systemctl enable xxxx.service

systemctl disable xxxx.service

3.打开/关闭防火墙服务

systemctl status firewalld

systemctl start firewalld.service(.service后缀可以省略)

systemctl stop firewalld.service

4.检测系统安装了某服务

systemctl list-unit-files| grep xxxx

disabled表示禁止开机自启动,enabled表示允许开机自启动,static表示与其他服务相关联,不能单独设置。

本课程一直关闭防火墙。

[展开全文]

 

安装

rpm -ivh xxx.rpm

卸载

rpm -e xxx

检测是否安装了某包()xxx必须推荐使用下面的第二个,第一个命令xxx必须为完全的名称

rpm -qa xxx 或者 rpm -qa | grep xxx (建议用第二种,过滤的方式)

安装rmp需要虚拟机挂载光盘镜像。rmp包需要与系统版本对应。

[展开全文]

VMWare中的虚拟机,主要存储在.vmdk文件中。

打开已有的虚拟机,要找.vmx文件。

[展开全文]

授课教师

专注Unity的VR开发

课程特色

下载资料(1)
视频(26)

学员动态