当我跑
sshpass -p 'mypass' sshfs 'root'@'68.19.40.16':/ '/dir' -o StrictHostKeyChecking=no,debug
Run Code Online (Sandbox Code Playgroud)
它成功安装,但它在前台运行。
当我在没有 'debug' 参数的情况下运行时,它根本不会挂载。
服务器是 ubuntu 8.04
任何想法为什么?
更新:当我以 ROOT 身份运行命令时,它确实挂载了。它不适用于其他用户。
这是挂载失败的输出
$ sshpass -p 'pass' sshfs 'root'@'68.1.1.1':/ '/s6' -o StrictHostKeyChecking=no,sshfs_debug,loglevel=debug
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 68.1.1.1 [68.1.1.1] port 22.
debug1: Connection established.
debug1: identity file /var/www/vhosts/devrim.kodingen.com/.ssh/id_rsa type -1
debug1: identity file /var/www/vhosts/devrim.kodingen.com/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debian-5
debug1: match: OpenSSH_5.1p1 Debian-5 pat OpenSSH*
debug1: Enabling …Run Code Online (Sandbox Code Playgroud) 让我首先为您提供我的设置的详细信息:
我在 x86_64 架构上运行 Fedora 13。我已经使用 sshfs 挂载了一个远程目录:
jim@localsite $ sshfs jim@remotesite:/home/jim /home/jim/remotemount
Run Code Online (Sandbox Code Playgroud)
现在如果 su 到 root 并尝试读取挂载点下的内容,我得到:
root@localsite $ ls -l /home/jim/remotemount
ls: cannot access remotemount: Permission denied
root@localsite $ ls -l /home/jim
total 0
drwxrwx---. 1 jim jim 90 Oct 1 12:00 bin
drwxrwx---. 1 jim jim 90 Oct 1 12:00 dev
d?????????? ? ? ? ? ? remotemount
drwxrwx---. 1 jim jim 90 Oct 1 12:00 tmp
Run Code Online (Sandbox Code Playgroud)
看到 root 无法访问 remotemount 目录是很奇怪的。这是预期的行为吗?如果是这样,为什么?如果没有,任何有关如何修复它的线索都会有所帮助。谢谢。
您在使用 ENCFS 和 SSHFS 进行远程备份方面的经验是什么?
我的主要疑惑是关于长期稳定性。
我使用sshfs将远程文件夹从另一台服务器挂载到本地服务器。使用以下命令挂载远程文件夹没有问题:
sshfs -o allow_other someServerFromSSHConfig:/home/data/somefolder/ /some/local/folder
Run Code Online (Sandbox Code Playgroud)
问题是我无法使用 chown 更改文件的所有者(无论 root 权限如何)我总是得到:
chown: changing ownership of ‘/somefolder/file.img’: Permission denied
Run Code Online (Sandbox Code Playgroud)
访问该文件夹的用户是 fuse 组的成员。即使我在 sshfs 中添加额外的挂载选项来设置所有者,因为userx:groupx我无法使用userx和使用更改权限chown -R userx:groupx [...]
我希望能够为已安装文件夹中的文件设置用户权限,但事实并非如此。
假设我有一个文件夹/mnt/mountpoint用作某些sshfs-mounted 目录的挂载点:
sshfs user@host /mnt/mountpoint
Run Code Online (Sandbox Code Playgroud)
现在,我想阻止应用程序在/mnt/mountpoint卸载时写入。我在这里和这里找到的问题的答案暗示使用
sudo chattr +i /mnt/mountpoint
Run Code Online (Sandbox Code Playgroud)
这可以很好地防止任何写访问。不幸的是,它也阻止了我sshfs作为普通用户安装。
什么是最好的解决方案?我更喜欢单个 sshfs-command 或至少不需要 root 权限的东西。我应该放弃这种chattr方法并尝试完全不同的方法吗?
我有下面的内容,/etc/fstab然后当我cd ~/dat0在那里做任何事情时,例如选项卡完成,每次都需要 10 秒。即它不缓存任何东西。
有什么办法可以加快速度吗?
ss@dat0: /home/ss/dat0 fuse.sshfs defaults,_netdev,identityfile=/home/ss/.ssh/id_rsa,uid=1000,gid=1000,allow_other 0 0
Run Code Online (Sandbox Code Playgroud) 我正在尝试将目录树从 OS X (10.11) 同步到 Ubuntu 14.04。虽然大多数文件都可以正常传输,但名称以_(下划线)开头的文件却不能。
这是我使用的命令:
rsync -rtvh --progress ~/Pictures/processed/ ~/mnt/processed/
Run Code Online (Sandbox Code Playgroud)
以及输出的示例:
sending incremental file list
_MG_7425.jpg
4.66M 100% 169.79MB/s 0:00:00 (xfr#1, to-chk=58/60)
_MG_7427.jpg
6.59M 100% 103.07MB/s 0:00:00 (xfr#2, to-chk=57/60)
...
rsync: mkstemp "/Users/user/mnt/processed/._MG_7425.jpg.0cAYb3" failed: No such file or directory (2)
rsync: mkstemp "/Users/user/mnt/processed/._MG_7427.jpg.5Gw1vD" failed: No such file or directory (2)
sent 306.24M bytes received 9.46K bytes 122.50M bytes/sec
total size is 306.17M speedup is 1.00
rsync error: some files/attrs were not transferred (see previous errors) …Run Code Online (Sandbox Code Playgroud) 我正在使用 sshfs 远程安装我的 /home 目录。由于服务器和客户端上的 UID 和 GID 不同,因此我使用idmap=file. 此外,由于应用程序要求,我必须安装所有 /home 而不是单个用户目录。
sshfs_uids:
user1:1001
user2:1000
Run Code Online (Sandbox Code Playgroud)
sshfs_gids:
user1:1001
user2:1000
Run Code Online (Sandbox Code Playgroud)
挂载命令:
sudo sshfs -o nonempty -o transform_symlinks -o hard_remove -o allow_other -o nomap=ignore -o idmap=file -o uidfile=/root/sshfs_uids -o gidfile=/root/sshfs_gids root@myserver:/home /home
Run Code Online (Sandbox Code Playgroud)
读取文件时,一切都按预期工作(应该由 user1:user1 拥有的文件确实如此)。但是,当我以 user1 身份写入时,会发生这种情况:
user1@myclient:~$ touch foo
user1@myclient:~$ ls -l foo
-rw-r--r--. 1 root root 0 Jun 13 13:54 foo
Run Code Online (Sandbox Code Playgroud)
我的用户以 root 身份写入文件!即使执行ls -lfrom myserver 也会出现相同的 root 所有权。不过我可以手动修复它:
user1@myclient:~$ chown user1:user1 foo
user1@myclient:~$ ls -l foo …Run Code Online (Sandbox Code Playgroud) 我有3台电脑。A、B 和 C。
A 是我现在使用的那个。B 是一个 jumphost,我可以通过 SSH 从 A 使用ssh -t B_host ssh C_host.
我想做的是通过 SSHFS 命令将 C 的文件系统挂载到 A,但简要查看手册页没有显示任何链接命令。
这可能吗?
根据https://github.com/libfuse/sshfs,sshfs现在是一个孤立项目,没有活跃的维护者。
是否有一种好的、安全的、健壮的替代方案可以用来挂载远程文件系统?