上接《小白学习Red Hat Linux7.0系列一之安装资源总结(VMware-workstation的安装号码和所有版本激活密匙、Linux6或7镜像版本提供)》《小白学习Red Hat Linux7.0系列二之bash: yum: command not found或Redhat This system is not registered with RHN错误》,本篇文章简单介绍下vsftp的安装命令、防火墙(firewalld)命令、SElinux设置。
systemctl命令
systemctl命令是系统服务管理器指令,它实际上将 service 和 chkconfig 这两个命令组合到一起,本人也是在使用Red Hat Linux7.0发现原"service httpd start"失效后,才了解的systemctl命令,特此展示已提示大家!
任务 | 旧指令 | 新指令 |
---|---|---|
使某服务自动启动 | chkconfig --level 3 httpd on | systemctl enable httpd.service |
使某服务不自动启动 | service httpd status | systemctl disable httpd.service |
检查服务状态 | chkconfig --level 3 httpd off | systemctl status httpd.service (服务详细信息) systemctl is-active httpd.service (仅显示是否 Active) |
显示所有已启动的服务 | chkconfig --list | systemctl list-units --type=service |
启动某服务 | service httpd start | systemctl start httpd.service |
停止某服务 | service httpd stop | systemctl stop httpd.service |
重启某服务 | service httpd restart | systemctl restart httpd.service |
vsftp指令
- 启动指令:systemctl start vsftpd.service
- 停止指令:systemctl stop vsftpd.service
- 状态查询指令:systemctl status vsftpd.service
- Linux开机时自动启动vsftpd指令:ystemctl enable vsftpd.service
防火墙(firewalld)指令
- 启动指令:sudo systemctl start firewalld.service
- 停止指令:sudo stop status firewalld.service
- 状态查询指令:sudo systemctl status firewalld.service
- 禁止指令:sudo systemctl disable firewalld.service
vsftp安装步骤
- 安装vsftp服务:yum install -y vsftpd,如报错请参照《小白学习Red Hat Linux7.0系列二之bash: yum: command not found或Redhat This system is not registered with RHN错误》。
- 关闭防火墙,首先查看防火墙的状态,Active显示为’dead’为关闭状态,显示’running’为开启状态,若状态为开启状态则运行停止指令关闭防火墙。
- 修改/etc/selinux/config文件中的SELINUX为disabled(SELINUX=disabled),然后reboot重启。
4.启动vsftpd服务,在浏览器输入’ftp://192.168.0.92/’,'192.168.0.92’为虚拟机IP,登录成功!