SFTP(SSH File Transfer Protocol)是基于SSH的安全文件传输协议,以下是安装配置步骤:
SFTP依赖于SSH服务,首先确认是否已安装:
rpm -qa | grep openssh-server
yum install -y openssh-server
编辑SSH配置文件:
vi /etc/ssh/sshd_config
找到并修改以下内容:
Subsystem sftp /usr/libexec/openssh/sftp-server
systemctl restart sshd
yum install -y vsftpd
编辑配置文件:
vi /etc/vsftpd/vsftpd.conf
常见配置项:
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
firewall-cmd --permanent --add-service=ftp
firewall-cmd --reload
systemctl start vsftpd
systemctl enable vsftpd
检查防火墙设置和SELinux状态:
setsebool -P ftpd_full_access on
确保用户对目录有适当权限:
chmod -R 755 /var/ftp/pub