During operation, you often have to work with remote files, often via ssh. Gnome allows you to connect and work with data using the Places-> Connect to Server utility, but unfortunately, not all programs can work this way ... Vim, for example, and since this is my main editor, I was looking for a way to do it. And found :)
Everything that is written further concerns Linux, in particular Ubuntu Linux.
So, a way: to mount remote system the same as you mount local disks. This can be done with the sshfs utility.
First you need to install it along with several dependencies:
$sudo apt-get install sshfs
Then you need to add yourself to the fuse user group. It is necessary to do this, because the program is installed in the system folders in which normal users are denied access. So, add yourself to the group:
')
$sudo adduser <> fuse
Then we create a directory for mounting, for example, on the desktop:
$mkdir ~/Desktop/test_ssh
Now you need to exit the terminal and log in again. Everything, now we are in the fuse group. Trying to connect to the server:
$sshfs user@example.com:/stuff ~/Desktop/test_ssh
If the connection is not on the key, then most likely you will be prompted to enter a password from the remote machine.
If you didn’t immediately receive the error
fusermount: fuse device not found, try 'modprobe fuse' first - check the directory, files should appear there :). If the error got out, it means that the fuse kernel module did not load automatically, we try to load it manually:
$sudo modprobe fuse
We try to establish the connection again.
To unmount this whole thing, you must do the following:
$fusermount -u ~/Desktop/test_ssh
In order not to enter such a bunch of commands each time, we create (if not) and edit the ~ / .bash_aliases file, adding the following lines to the end:
alias testssh='sshfs user@example.com:/stuff ~/Desktop/test_ssh'
alias testssh_umount='fusermount -u ~/Desktop/test_ssh'
Now you can mount the remote machine with the
testssh command, and unmount the
testssh_umount :)
Thank you for your attention!
Threat Article first translated from English into
Ukrainian , added a bit of his and translated into Russian for Habr :)