Unable to mount SSHFS directory with rw permission

问题描述 投票:0回答:1

我在 CentOS 7.6 机器上有一个目录,我想挂载到另一台运行 RedHat 7.9 的机器上。

在 RedHat 机器上,我将此行添加到 /etc/fstab:

[email protected]:/mnt/Scan-PDF /mnt/scanfiles/ fuse.sshfs rw,x-systemd.automount,x-systemd.nofail,_netdev,idmap=user,allow_other,transform_symlinks,identityfile=/root/.ssh/id_rsa,umask=0222     0 0

一直在尝试uid、user等各种选项,结果都是一样的,文件系统挂载为只读。文件 /proc/mounts 显示两个条目(为什么是 2 个?):

systemd-1 /mnt/scanfiles autofs rw,relatime,fd=33,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=26826 0 0
[email protected]:/mnt/Scan-PDF /mnt/scanfiles fuse.sshfs ro,nosuid,nodev,noexec,relatime,user_id=0,group_id=0,default_permissions,allow_other 0 0
linux fuse sshfs
1个回答
0
投票

看起来文件系统被挂载为只读,这可能会导致访问或修改远程系统上的文件出现问题。

要检查的一件事是远程目录 (/mnt/Scan-PDF) 的权限。确保本地计算机上的用户具有读取和写入目录的适当权限。

另一件事是在 /etc/fstab 中的挂载命令中添加“rw”选项:

[email protected]:/mnt/Scan-PDF /mnt/scanfiles/ fuse.sshfs rw,x-systemd.automount,x-systemd.nofail,_netdev,idmap=user,allow_other,transform_symlinks,identityfile=/root/.ssh/id_rsa,umask=0222 0 0

此外,尝试从 mount 命令中删除“ro”选项,看看是否有帮助:

[email protected]:/mnt/Scan-PDF /mnt/scanfiles/ fuse.sshfs nosuid,nodev,noexec,relatime,user_id=0,group_id=0,default_permissions,allow_other,rw,transform_symlinks,identityfile=/root/.ssh/id_rsa,umask=0222 0 0

对 /etc/fstab 进行更改后,您可以尝试使用命令“mount -a”重新挂载文件系统以查看更改是否生效。

© www.soinside.com 2019 - 2024. All rights reserved.