RHEL7 root 开启FTP服务  root FTP开启有风险 仅供临时使用

1.安装并开启相关服务

#yum install -y vsftpd ftp ## 安装vsftpd服务

# systemctl status vsftpd

● vsftpd.service - Vsftpd ftp daemon

   Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; disabled; vendor preset: disabled)

   Active: inactive (dead)

# systemctl start vsftpd

# systemctl enable vsftpd

Created symlink from /etc/systemd/system/multi-user.target.wants/vsftpd.service to /usr/lib/systemd/system/vsftpd.service.

# systemctl status vsftpd

● vsftpd.service - Vsftpd ftp daemon

   Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; disabled; vendor preset: disabled)

   Active: active (running) since Thu 2021-03-11 09:14:00 CST; 6s ago

  Process: 26880 ExecStart=/usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf (code=exited, status=0/SUCCESS)

 Main PID: 26882 (vsftpd)

    Tasks: 1

   CGroup: /system.slice/vsftpd.service

           └─26882 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf


Mar 11 09:14:00 rhel7-rac1.skhynix-cq.com.cn systemd[1]: Starting Vsftpd ftp daemon...

Mar 11 09:14:00 rhel7-rac1.skhynix-cq.com.cn systemd[1]: Started Vsftpd ftp daemon.

2.修改相关参数

# cat /etc/vsftpd/vsftpd.conf 

anonymous_enable=NO   ## 关闭匿名登录

#vi  /etc/vsftpd/user_list

# vsftpd userlist

# If userlist_deny=NO, only allow users in this file

# If userlist_deny=YES (default), never allow users in this file, and

# do not even prompt for a password.

# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers

# for users that are denied.

#root      ##注释掉ROOT

#vi /etc/vsftpd/ftpusers

# Users that are not allowed to login via ftp

#root     ##注释掉ROOT

# systemctl restart vsftpd    ##重启VSFTPD服务

3.测试 注意防火墙相关是关闭的.

# systemctl stop firewalld.service 

# systemctl disable firewalld.service 

Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.

Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

# ftp localhost  ##测试

Trying ::1...

Connected to localhost (::1).

220 (vsFTPd 3.0.2)

Name (localhost:root): root

331 Please specify the password.

Password:

230 Login successful.

Remote system type is UNIX.

Using binary mode to transfer files.