- 安装sshfs
- yum install sshfs
- 使用SSHFS挂载远程的文件系统
- 假如挂载到本机的/root目录,如果是非root用户登录,需要使用root用户,并执行命令更改权限
- chmod 777 -R /root/test
- 执行挂载 sshfs 远程主机用户名@远程主机IP:/OA/RP/ /root/test
- 测试是否挂载成功 df -h
- 设置开机自启动挂载
- touch auto.sh
- 写入开机启动脚本: echo 远程主机密码 | sshfs 远程主机用户@远程ip:/OA/RP/ /root/test -o workaround=rename -o password_stdin -o allow_other
- chmod +x auto.sh
- vim /etc/rc.d/rc.local
- 写入 sh /home/autosu.sh
- chmod +x /etc/rc.d/rc.local //开机自动启动
- 卸载远程文件系统 umount /root/test
Centos7.6使用sshfs挂载远程主机
于 2022-03-01 15:27:52 首次发布