CentOS安装SFTP服务步骤如下:
sudo yum update -y。sudo yum install openssh-server -y。sudo systemctl start sshd,sudo systemctl enable sshd。/etc/ssh/sshd_config文件,确保Subsystem sftp /usr/libexec/openssh/sftp-server未被注释,可根据需要添加限制用户SFTP访问的配置,如Match Group sftpusers等。sftpusers)和用户,设置其家目录及权限,如在/etc/ssh/sshd_config中用ChrootDirectory限制用户根目录。sudo systemctl restart sshd。sudo firewall-cmd --permanent --add-service=ssh,sudo firewall-cmd --reload。