我将使用“本地机器-冲浪盒”来表示您连接的计算机,使用“远程机器-开发盒”来表示您连接到的计算机。
检查您的userID和groupID,它们应该都是1000。
GroupID:id -g localuser
UserID:id -u localuser
hostname -I
sudo apt install sshfs fuse ssh
创建群组:sudo groupadd fuse
将本地用户添加到群组中:sudo usermod -a -G fuse $USER
在fstab中挂载时,我们需要这个选项
使用命令行编辑器编辑/etc/fuse.conf
。
删除user_allow_other
前面的井号,并保存。
当提示时,请不要提供密码。只需按Enter键留空即可。
ssh-keygen -t rsa -C youremail@example.com
密钥存储在本地机器的主目录下的.ssh文件夹中
ssh-copy-id -i ~/.ssh/id_rsa.pub remoteuser@192.168.1.151
您将被要求输入远程机器上远程用户的密码。 本地机器的公钥现已添加到远程机器上的文件~/.ssh/authorized_keys中。
7. 在本地机器的/mnt文件夹上创建一个目录,您将在其中挂载远程机器的/home文件夹。ServerAliveCountMax
次 ping 失败,则重新连接。在 Local 和 Remote 机器上以 steve 用户登录的用户将具有以下设置:
steve@192.168.1.151:/home/steve/ /mnt/devboxhome fuse.sshfs default_permissions,user,delay_connect,reconnect,ServerAliveInterval=15,ServerAliveCountmax=3,allow_other,identityfile=/home/steve/.ssh/id_rsa,idmap=user,uid=1000,gid=1000 0 0
重要:远程目录后面加一个斜杠:steve@192.168.1.151:/home/steve/
保存/etc/fstab和....
现在,您应该能够在本地机器/mnt/devboxhome中访问远程机器的/home目录。在Nautilus中,您可以将此文件夹拖到“位置”栏。
在远程机器上再次执行相同步骤,以共享本地机器的/home目录。
link text
已失效,未找到(404)。 - dipenparmar12python3 -m http.server
。 - VanDavvsudo apt-get install openssh-server
sftp://servername.local
sshfs
在客户端文件系统中创建一个挂载点。scp
,以及(更好的)rsync
。 - Brent Bradburn我相信这是SAMBA软件包所列出的,或者至少是它们描述的一部分。作为另一种选择,您可以尝试首选项->文件共享,我相信它使用了不同的机制。不过,安装Samba还是很方便的。
zx81roadkill 是对的,使用 "sshfs"。Samba 是垃圾,NFS 是废物。从我在加利福尼亚的电脑到阿根廷的电脑,完全可以使用 Sshfs。它是完全安全的,速度和其他任何东西一样快(我有一个千兆线)。
Sshfs 相对于 Samba 和 NFS 来说是一个相对较新的技术,但它比两者都要优秀得多。以下是运行它的示例(假设您已经安装了所有必要的软件包)。
# mount "username"'s home directory on "machine"
mkdir -p /tmp/my_mount ; sshfs username@machine: /tmp/my_mount
# mount the root directory on "machine" (note: if "username" on "machine"
# can't write to the file, neither will you. You have "username"'s privs
mkdir -p /tmp/my_mount ; sshfs username@machine:/ /tmp/my_mount
# mount the directory "Videos" on "username"'s account on "machine"
mkdir -p /tmp/my_mount ; sshfs username@machine:Videos /tmp/my_mount
fusermount -u /tmp/my_mount
如果那失败了(无论出于何种原因):
umount -f /tmp/my_mount
sudo npm install -g http-server
http-server -o