ubuntu共享文件夹挂载_如何在Ubuntu上使用SSH挂载远程文件夹

ubuntu共享文件夹挂载

Connecting to a server across the internet is much more secure using SSH. There is a way that you can mount a folder on a remote server using the SSHFS service.

使用SSH通过Internet连接到服务器要安全得多。 有一种方法可以使用SSHFS服务将文件夹安装在远程服务器上。

There are quite a few steps that you’ll have to follow, so get ready and open a terminal window.

您必须遵循很多步骤,因此请做好准备并打开终端窗口。

First we’ll install the module:

首先,我们将安装模块:

sudo apt-get install sshfs

须藤apt-get install sshfs

Now we will use the modprobe command to load it

现在我们将使用modprobe命令加载它

sudo modprobe fuse

sudo modprobe保险丝

We’ll need to set up some permissions in order to access the utilities. Replace <username> with your username.

我们需要设置一些权限才能访问实用程序。 将<username>替换为您的用户名。

sudo adduser <username> fuse

sudo adduser <用户名>保险丝

sudo chown root:fuse /dev/fuse

sudo chown root:保险丝/ dev / fuse

sudo chmod +x /dev/fusermount

须藤chmod + x / dev / fusermount

Since we’ve added ourselves to a user group, we need to logout and back in at this point before we continue.

由于我们已将自己添加到用户组中,因此我们需要先注销并重新登录,然后再继续。

Now we’ll create a directory to mount the remote folder in. I chose to create it in my home directory and call it remoteserv.

现在,我们将创建一个目录来安装远程文件夹。我选择在主目录中创建该目录,并将其命名为remoteserv。

mkdir ~/remoteserv

mkdir〜/ remoteserv

Now we have the command to actually mount it. You’ll be prompted to save the server key and for your remote password.

现在我们有了实际安装它的命令。 系统将提示您保存服务器**和输入远程密码。

sshfs <username>@<ipaddress>:/remotepath ~/remoteserv

sshfs <用户名> @ <ipaddress>:/ remotepath〜/ remoteserv

Now you should be able to cd into the directory and start using it as if it was local.

现在,您应该可以进入该目录并开始使用它,就好像它是本地目录一样。

[email protected]:~/remoteserv$ ls -l total 16 drwxr-xr-x 1 951247 155725 4096 2006-12-13 13:30 howtogeek.com drwxr-sr-x 1 root root 4096 2006-09-11 06:45 logs drwx—— 1 951247 155725 4096 2006-08-11 16:09 Maildir drwxrwxr-x 1 951247 155725 4096 2006-10-29 02:34 scripts

geek @ ubuntuServ:〜/ remoteserv $ ls -l总计16 drwxr-xr-x 1 951247 155725 4096 2006-12-13 13:30 howtogeek.com drwxr-sr-x 1根根4096 2006-09-11 06:45日志drwx—— 1 951247 155725 4096 2006-08-11 16:09 Maildir drwxrwxr-x 1 951247 155725 4096 2006-10-29 02:34脚本

翻译自: https://www.howtogeek.com/howto/ubuntu/how-to-mount-a-remote-folder-using-ssh-on-ubuntu/

ubuntu共享文件夹挂载

相关文章: