Install vsftpd

All commands should be run with ‘root’ user. Run the following command in terminal to install vsftpd package:

yum install vsftpd ftp -y

Configure vsftpd

Edit vsftpd configuration file /etc/vsftpd/vsftpd.conf,

vi /etc/vsftpd/vsftpd.conf

Find the following lines and make the changes as shown below:

 [...]
## Disable anonymous login ##
anonymous_enable=NO ## Uncomment ##
ascii_upload_enable=YES
ascii_download_enable=YES ## Uncomment - Enter your Welcome message - This is optional ##
ftpd_banner=Welcome to UNIXMEN FTP service. ## Add at the end of this  file ##
use_localtime=YES

Enable and start the vsftpd service:

systemctl enable vsftpd
systemctl start vsftpd

Firewall And SELinux Configuration

Allow the ftp service and port 21 via firewall.

firewall-cmd --permanent --add-port=21/tcp
firewall-cmd --permanent --add-service=ftp

Restart firewall:

firewall-cmd --reload

Then, update the SELinux boolean values for FTP service:

setsebool -P ftp_home_dir on

Create FTP users

By default, root user is not allowed to login to ftp server for security purpose. So, let us create a normal testing user called “sk” with password “centos”.

useradd sk
passwd sk

Connecting to FTP server

Now, try to connect to FTP server itself with user “sk”:

ftp 192.168.1.101

Enter the ftp user name and password.

Sample Output:

Connected to 192.168.1.101 (192.168.1.101).
220 Welcome to UNIXMEN FTP service.
Name (192.168.1.101:root): sk
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> 最后,如果出现500 OOPS: chroot的错误,说明系统中没有ftp_home_dir目录,那么需要用以下命令代替:
setsebool -P ftpd_full_access 1

如果出现ftp能连接,但是ls出现connect refuse的错误,需要将selinux关闭。修改方法为打开/etc/selinux/config文件,将SELINUX改为disabled即可。

最新文章

  1. ASP.NET Core 中间件之压缩、缓存
  2. ORACLE opatch命令学习实践
  3. maven项目常见问题
  4. there are no usable controls in this group
  5. Winform 五种常用对话框控件的简单使用
  6. HTML5 新增属性和废除属性
  7. 浅谈FloatingActionButton(悬浮按钮)
  8. DBA的技能图谱
  9. python(八)内置模块logging/os/time/sys/json/pickle
  10. 浅谈AsyncState与AsyncDelegate使用的异同
  11. sort排序中的坑
  12. 文件权限和目录权限详解(rwx)
  13. linux 命令之 uptime
  14. APK反编译。
  15. C++赋值运算符与赋值表达式
  16. Linux 安装Xampp以后,Apache服务器无法启动,以及启动后,连接sql数据库遇到的问题的解决方法
  17. 新概念英语(1-25)Mrs. Smith's Kitchen
  18. vue中 父子组件的通讯
  19. PyCharm 2019 最新激活方式总结(最新最全最有效!!!
  20. 5A - 超级楼梯

热门文章

  1. 转 MySQL实验(三) 过程式数据库对象的使用
  2. 转:python中使用txt文本保存和读取变量
  3. js执行顺序——学习笔记
  4. 数据库恢复挂起解决办法【MSSQL】
  5. 如何手工搭建本地Yum仓库
  6. [ NOI 2002 ] 银河英雄传说
  7. [ POI 2005 ] Bank Notes
  8. 完成fcc作业2时思路
  9. Appium基于python unittest自动化测试并生成html测试报告
  10. C++(Typedef声明)