在VM虚拟机中安装FTP服务

自用的话,建议先关掉防火墙

systemctl stop firewalld #关闭防火墙
systemctl disable firewalld.service #设置开机禁用防火墙
systemctl start firewalld #启动防火墙
systemctl enable firewalld.service #设置开机启用防火墙
systemctl status firewalld  #检查防火墙状态

 

1. 安装ftp

yum -y install vsftpd 

查看

vsftpd -v

 

2. 取消匿名登陆

修改vsftpd.conf文件

vi /etc/vsftpd/vsftpd.conf

把 anonymous_enable=YES,改为NO,然后重启vsftpd

3、设置开机启动

chkconfig vsftpd on

 

4、启动ftp服务

service vsftpd start

检查服务状态

service vsftpd status

停止服务:

service vsftpd stop

重启服务

service vsftpd restart

 

5. vi /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
#SELINUX=enforcing
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
#SELINUXTYPE=targeted
SELINUX=disabled

 

6. 关闭防火墙

setenforce 0 #设置SELinux 成为permissive模式 临时关闭selinux的防火墙

查看SELinux状态

getenforce

修改好之后,reboot重启下,然后执行getenforce命令查看SELinux状态

再次查看SELinux状态

显示 Disabled

 

7.获取本地IP地址

ip address

找到类似192.168.x.x的IP地址,记下来

 

8. 连接FTP

 

 

打开xshell,新建会话,输入192.168.x.x,点击连接,根据提示,输入用户名密码即可(用户名是当前用户root,密码是进入linux系统的密码,连接就可以了)。

 

原文地址:在虚拟机中安装ftp_ITPUB博客

posted @ 2021-06-29 15:30  一叶、知秋  阅读(1891)  评论(0编辑  收藏  举报