重新安装服务器后我无法安装它
sshfs root@domain.com:/var /remote_mount
fuse: bad mount point `/remote_mount': Transport endpoint is not connected
Run Code Online (Sandbox Code Playgroud)
# ssh root@domain.com
The authenticity of host 'domain.com (xxx.xxx.xxx.xxx)' can't be established.
ECDSA key fingerprint is 57:b6:bd:76:17:80:73:85:4a:14:8a:6f:dc:fa:fe:7c.
Are you sure you want to continue connecting (yes/no)?
Run Code Online (Sandbox Code Playgroud) 对于我正在学习的操作系统课程,我需要运行 Freebsd5.4。由于我不想在 git 发布之前发布的 bsd 版本上尝试构建 git,我认为git从 Arch over使用它会很整洁sshfs。
无论如何,我找到了一个建议我给出选项的解决方法。sshfs-o workaround=rename
看起来git很开心,但我对刚刚发生的事情感到很困惑......
关于解决方法的所有手册页说的是
fix renaming to existing file
Run Code Online (Sandbox Code Playgroud)
但我完全不明白这意味着什么......
该选项究竟有什么作用?
我尝试 sshfs 挂载远程目录,但挂载的文件不可写。我已经没有想法或方法来调试这个了。有什么我应该在远程服务器上检查的吗?
我使用的是 Xubuntu 14.04。我挂载了 14.04 Ubuntu 的远程目录。
local $ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.3 LTS
Release: 14.04
Codename: trusty
Run Code Online (Sandbox Code Playgroud)
我改变了/etc/fuse.conf
local $ sudo cat /etc/fuse.conf
# /etc/fuse.conf - Configuration file for Filesystem in Userspace (FUSE)
# Set the maximum number of FUSE mounts allowed to non-root users.
# The default is 1000.
#mount_max = 1000
# Allow non-root users to specify the allow_other or allow_root mount options.
user_allow_other
Run Code Online (Sandbox Code Playgroud)
我的用户在保险丝组中
local …Run Code Online (Sandbox Code Playgroud) 如果我使用远程主机 (ssh://) 作为源/目标运行 rsync 或使用本地路径通过 sshfs 共享挂载目录有什么区别吗?
在不使用任何开关的情况下,安全性或复制速度是否存在差异,只需使用 rsync 存档模式和远程主机路径 (ssh)。与 sshfs 相同,仅使用源和目标挂载(没有密码更改,只是默认值)。
谢谢sshfs魔术,我可以从远程服务器挂载我的主目录
sshfs user@server:/home/user ~/remote
Run Code Online (Sandbox Code Playgroud)
乐观地,我认为我会在(在挂载中)设置一个本地inotify-hook,以便本地程序可以对远程日志更改做出反应。~/remote/logFilesshfs
cd ~/remote
touch logFile # create remote file
inotifywait logFile & # set up local inotify-hook
ssh user@server -x touch /home/user/logFile # touch file from remote
Run Code Online (Sandbox Code Playgroud)
什么也没有发生。inotifywait除非我touch在本地保存文件,否则是无声的。写入命名管道同样失败。
为什么是这样?
我怎样才能弥合这个差距?
我可以inotifywait在远程运行,修改文件系统更改序列化策略并保持与本地的连接,但是我基本上是在重新实现 SSHFS。它完全扼杀了抽象。
正如您在下面看到的,我能够将用户从 kevcoder00 映射到 kevcoder01,但该组被映射到万寿菊,尽管 kevcoder01 上不存在该组
l00py@kevcoder00:~$ sshfs -o idmap=user l00py@kevcoder01:/home/l00py ~/kevcoder01/
l00py@kevcoder01's password:
l00py@kevcoder00:~$ ls -hl kevcoder01/
total 0
-rw-r--r-- 1 l00py marigold 0 Jul 4 00:34 I_LIVE
-rw-r--r-- 1 l00py marigold 0 Jul 4 00:59 I_LIVE_AGAIN
Run Code Online (Sandbox Code Playgroud)
我需要做什么来映射用户和组?
Local: Linux Mint 15 - Olivia
/proc/version: Linux version 3.8.0-19-generic (buildd@allspice) (gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1) )
ssh -V: OpenSSH_6.1p1 Debian-4, OpenSSL 1.0.1c 10 May 2012
sshfs -V: SSHFS version 2.4
FUSE library version: 2.9.0
fusermount version: 2.9.0
using FUSE kernel interface version 7.18
Remote: Ubuntu 12.04.3 LTS
/proc/version: Linux version 3.10.9-xxxx-std-ipv6-64 (kernel@kernel.ovh.net) (gcc version 4.7.2 (Debian 4.7.2-5) )
ssh -V: OpenSSH_5.9p1 Debian-5ubuntu1.1, OpenSSL 1.0.1 14 Mar 2012
Run Code Online (Sandbox Code Playgroud)
我正在尝试使用 sshfs 和 fuse 设置远程服务器的无密码安装。远程服务器在非标准端口上运行,我将使用 ssh 密钥对进行身份验证。
成功后,我将对另外三个远程服务器重复此操作,每个服务器都有不同的键,因此我确实需要能够指定哪些键映射到哪个远程服务器。
我的修改基于本教程
我安装四个服务器(3通过cifs,经由1 sshfs)使用autofs。
auto.master
/- /etc/auto.all --timeout=60 --ghost
Run Code Online (Sandbox Code Playgroud)
auto.all
/mnt \
/server1 -fstype=cifs,rw,credentials=/etc/.smbcredentials.txt,uid=1000,file_mode=0775,dir_mode=0775,users ://server1/ \
/server2/ -fstype=cifs,rw,credentials=/etc/.smbcredentials.txt,uid=1000,file_mode=0775,dir_mode=0775,users ://server2/ \
/server3 -fstype=cifs,rw,credentials=/etc/.smbcredentials.txt,uid=1000,file_mode=0775,dir_mode=0775,users ://server3/ \
/server4 -fstype=fuse,rw,allow_other,uid=1000,users,reconnect,cache=yes,kernel_cache,compression=no,large_read,Ciphers=arcfour :sshfs\#user@server\:/home
Run Code Online (Sandbox Code Playgroud)
``
当我进行干净启动时,一切都很好。我连接到我的网络(使用 VPN)并autofs安装所有内容。
当网络断开时,例如当我休眠我的笔记本电脑或连接到不同的网络时,autofs会导致我的资源管理器(海豚)冻结,因为它试图无限加载远程共享。
它变得无响应,甚至不响应 SIGTERM 命令。有时候,我很幸运,并呼吁sudo service autofs stop并sudo automount帮助解决问题。然而,它通常仍然保持冻结状态。有时,我的整个 Dock 甚至会因为这使所有应用程序无法选择而冻结。然后我必须完全重新启动..
我已经搜索了数周来寻找如何处理autofs这种情况的解决方案。在使用 之前autofs,我通过安装了所有东西,/etc/fstab但在每次网络中断后也需要手动重新安装。
我以为autofs会在这里帮助我,但它给我带来了更多的麻烦。
autofs?PS:我在 Kubuntu 16.04
sftp 命令支持一个子系统选项 (-s),它允许远程用户选择远程 sftp-server 可执行文件,并在这个过程中可选地升级到 sudo;
sftp -s "/usr/bin/sudo /usr/libexec/openssh/sftp-server" xxx.yyy.zzz.aaa
Run Code Online (Sandbox Code Playgroud)
此命令遵循 ~/.ssh/config 中的 ssh 客户端选项,允许透明使用公钥和自定义端口和用户设置。
然而,它subsystem似乎是 sftp 特定的,因此它没有在配置文件中设置,它似乎必须设置为 sftp 的命令行选项。
然而,一些工具包装了 sftp 调用,因此无法设置子系统选项,因此卡住了用户访问。
是否有一些配置选项文件我可以用来为openssh sftp设置这个?
是否有一些配置文件会影响 gnome nautilus 调用 sftp 以进行文件管理器集成的方式?
更新可能的hacky-but-functioning解决方案是......
所以事实证明没有明显的配置文件 sftp 将用于选项,所以我最终修改了一个通用包装脚本,通过将它放在我的路径中来为我选择的主机显式添加选项;
#!/bin/bash
# Generic shell wrapper that performs an operation
OPERATION=/usr/bin/sftp
args=("$@")
#the final arg should contain a hostname of the form [user@]host[:path]
case "${args[@]: -1}" in
myserver.com)
exec $OPERATION -s "/usr/bin/sudo /usr/libexec/openssh/sftp-server" "$args"
;;
*)
exec $OPERATION "$args"
;;
esac
Run Code Online (Sandbox Code Playgroud)
然而, …
我在 fstab 中使用 sshfs 在 Ubuntu 18.04.04 LTS 中挂载文件系统:
sshfs#dave@myservergoeshere.com:/remote-dir /mnt/local-mnt fuse rw,exec,user,allow_other,noauto,reconnect,ServerAliveInterval=15,ServerAliveCountMax=3 0 0
Run Code Online (Sandbox Code Playgroud)
它安装得很好,但是如果我尝试在路径中执行任何操作,我会得到:
./some-executable: Permission denied.
Run Code Online (Sandbox Code Playgroud)
该文件具有执行权限(如果我确实通过 ssh 进入系统,则可以正常工作)。
如果我使用 fstab 但再次包含 -oexec 选项:
mount /mnt/local-mnt -oexec
Run Code Online (Sandbox Code Playgroud)
然后它起作用了。为什么 fstab 'exec' 被忽略?