我正在尝试在 ubuntu 上使用 sshfs。我在尝试连接的服务器上拥有 root 访问权限。但每次我尝试使用我的 ubuntu 笔记本电脑进行连接时,我收到的消息如下:
cp@cp-AOA150:/$ sudo sshfs root@myserver:/ /home/cp/Documents/myserverfolder/
read: Connection reset by peer
cp@cp-AOA150:/$
Run Code Online (Sandbox Code Playgroud)
我对 ubuntu / linux 不太熟悉,但问题可能是服务器上的密钥不是用户“cp”的吗?
如果是这种情况,我如何在 ubuntu 上设置 root 帐户?
任何建议,将不胜感激。
顺便提一句。我可以 ssh 进入盒子没有问题,但作为 root。所以换句话说,这有效:
ssh root@myservername
Run Code Online (Sandbox Code Playgroud)
我已将工作中的密钥文件复制到这台新笔记本电脑上。只是 sshfs 现在不开心。谢谢。
编辑 1
当我使用调试选项运行 sshfs 时:
cp@cp-AOA150:~$ sshfs -o sshfs_debug -p 22 root@10.14.5.182:/ /home/cp/Documents/myserverfolder/
Run Code Online (Sandbox Code Playgroud)
我收到以下错误消息:
SSHFS version 2.4
fusermount: user has no write access to mountpoint /home/cp/Documents/myserverfolder/
cp@cp-AOA150:~$
Run Code Online (Sandbox Code Playgroud)
我已经检查了文件夹 myserverfolder 的权限,它看起来像这样:(ls -la 命令的结果)
drwxr-xr-x 2 root root 4096 Mar 19 17:11 .
drwxr-xr-x 4 cp cp 4096 Mar 19 17:11 ..
Run Code Online (Sandbox Code Playgroud)
编辑 2
我已经确保用户 cp 是保险丝组的一部分。
cp@cp-AOA150:~$ sudo addgroup cp fuse
[sudo] password for cp:
The user `cp' is already a member of `fuse'.
cp@cp-AOA150:~$
Run Code Online (Sandbox Code Playgroud)
编辑 3
ls -ld 的结果
cp@cp-AOA150:~$ ls -ld /home/cp/Documents/myserverfolder
drwxr-xr-x 2 root root 4096 Mar 19 17:11 /home/cp/Documents/myserverfolder
cp@cp-AOA150:~$
Run Code Online (Sandbox Code Playgroud)
我对 linux 还不太熟悉,但我确实尝试使用 vim 在这个文件夹中创建一个文件。我无法保存文件...我想我使用 mkdir 命令的“sudo”前缀创建了文件夹...因为当我尝试不使用 sudo 时,我收到“权限被拒绝”错误消息。我要去谷歌“chmod”,看看我如何在这个文件夹上授予 cp 权限。
一些想法:
sshfs
与sudo
!此外,sshfs
是一个用户空间文件系统ssh-copy-id -i ~/.ssh/id_rsa.pub root@myserver
-p
sshfs 选项-o sshfs_debug
fuse
组的成员:sudo addgroup YOUR_USER fuse
例子:
mkdir ~/mnttest
sshfs -o sshfs_debug -p 22 root@myserver:/ ~/mnttest
Run Code Online (Sandbox Code Playgroud)
卸载:
fusermount -u ~/mnttest
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
13897 次 |
最近记录: |