curlftpfs
该命令可以实现将ftp连接访问到的内容挂载到本地盘符。
#安装yum install curlftpfs#创建需要挂载的目录cd /mnt/mkdir ftpfile#创建ftp挂载curlftpfs -o rw,allow_other,uid=1000,gid=1000 ftp://f100274:h4kC43iYL@197.112.0.95 /mnt/ftpfile#查看进程 可以看到 ftp挂载命令会作为一个后台进程不断的获取ftp的内容ps -efroot 3895 1 0 09:59 ? 00:00:00 curlftpfs -o rw,allow_other,uid=1000,gid=1000 ftp://f100274:h4kC43iYL@197.112.0#编辑nginx将目录内容通过http展现vim /etc/nginx/nginx.conf#内容如下location / {root /mnt/ftpfile;autoindex on;}#检查nginx配置文件正确性nginx -t#重启nginxsystemctl restart nginx#设置开机自动挂载 其实也就是开机自动运行这条命令sudo echo "curlftpfs -o rw,allow_other,uid=1000,gid=1000 ftp://f100274:h4kC43iYL@197.112.0.95 /mnt/ftpfile" >> /etc/fstab
最后效果


sftp解决方案
echo ‘U9es6K3jT’ | sshfs -o allow_other ftl-user@197.112.10.24:/ /mnt/ftpfile -o password_stdin
