1 环境
- Red Hat Enterprise Linux release 8.2 (Ootpa)
- vsftpd-3.0.3-32.el8.x86_64
2 配置步骤
2.1 建立ftp 用户并更新密码
1 | # useradd -d /mnt/oostech_ftp -s /bin/nologin oostechftp && echo 'samlee:oostechftp' | chpasswd |
2.2 给目录修改权限
1 | # chown -R oostechftp:oostechftp /mnt/oostech_ftp |
2.3 修改 vsftp 的pam 配置
1 | # cat /etc/pam.d/vsftpd |
2.4 建立vsftp 配置文件(可以先将原来的备份,然后新建一份/etc/vsftpd/vsftpd.conf)
1 | anonymous_enable=NO |
附录 1 关于 550 Permission denied 错误
- 错误信息
1
2
3
4ftp> put Makefile
local: Makefile remote: Makefile
227 Entering Passive Mode (150,150,150,30,190,88).
550 Permission denied. - 修复 (必须在 /etc/vsftpd/vsftpd.conf 配上)
1
virtual_use_local_privs=YES
- 验证
1
2
3
4
5
6
7ftp> put Makefile
local: Makefile remote: Makefile
227 Entering Passive Mode (150,150,150,30,127,153).
150 Ok to send data.
226 Transfer complete.
849 bytes sent in 0.00203 secs (417.61 Kbytes/sec)
ftp>