{"id":1139,"date":"2020-11-23T16:53:12","date_gmt":"2020-11-23T13:53:12","guid":{"rendered":"https:\/\/blog.airmeno.ru\/?p=1139"},"modified":"2020-11-23T17:02:48","modified_gmt":"2020-11-23T14:02:48","slug":"fuse-sshfs-ili-udalennaya-fajlovaya-sistema-cherez-ssh","status":"publish","type":"post","link":"https:\/\/blog.airmeno.ru\/?p=1139","title":{"rendered":"FUSE (SSHFS) \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u0430\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0447\u0435\u0440\u0435\u0437 SSH"},"content":{"rendered":"\n<p>FUSE (filesystem in userspace) &#8212; \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u044f\u0434\u0435\u0440 Unix-\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0431\u0435\u0437 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0439 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u042d\u0442\u043e \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u0441\u0447\u0451\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u0434\u0430 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435, \u0430 \u043c\u043e\u0434\u0443\u043b\u044c FUSE \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0432\u044f\u0437\u0443\u044e\u0449\u0438\u043c \u043c\u0435\u0436\u0434\u0443 \u044f\u0434\u0440\u043e\u043c \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c (userspace). C \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0440\u0435\u0434\u0441\u0442\u0432 FUSE \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b SSHFS, NTFS-3G, GlusterFS, ZFS.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>\u0420\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044f\u043c\u0438 GNU GPL \u0438 LGPL. \u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0451\u043d \u0432 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u044f\u0434\u0440\u0430 Linux \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 2.6.14<\/p>\n\n\n\n<p>\u0411\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438\u2026 \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0431\u0435\u0437 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0439 \u043c\u043e\u0436\u0435\u0442 \u0441\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0431\u0435 \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043f\u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u043c\u0443 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044e \u0447\u0435\u0440\u0435\u0437 ssh.<\/p>\n\n\n\n<p>\u0411\u0443\u0434\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0441 CentOS \u043d\u0430 Debian, \u043c\u043e\u0436\u043d\u043e \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442 \u0441 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u044b yum \u043d\u0430 apt.<\/p>\n\n\n\n<p>\u0421\u0442\u0430\u0432\u0438\u043c sshfs:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo yum install sshfs<\/code><\/pre>\n\n\n\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0430\u043f\u043a\u0443 \u0434\u043b\u044f \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0438:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ mkdir \/home\/local_user\/ruser<\/code><\/pre>\n\n\n\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sshfs remoute_user@server_name:\/dir\/ \/home\/local_user\/ruser<\/code><\/pre>\n\n\n\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u0440\u0442 SSH \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e, \u0442\u043e (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 1234):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sshfs -p 1234 local_user@server_name:\/dir\/ \/home\/local_user\/ruser<\/code><\/pre>\n\n\n\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0434\u0438\u0441\u043a:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ df -Th<\/code><\/pre>\n\n\n\n<p>\u041e\u0442\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ fusermount -u \/home\/local_user\/ruser<\/code><\/pre>\n\n\n\n<p><strong>\u0410\u0432\u0442\u043e\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/strong><\/p>\n\n\n\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u0442\u043e \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u043e ssh \u043a\u043b\u044e\u0447\u0443 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0438\u043d\u0430\u0447\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442. \u041f\u0440\u043e\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, ssh \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0431\u0435\u0437 \u0432\u0432\u043e\u0434\u0430 \u043f\u0430\u0440\u043e\u043b\u044f. <\/p>\n\n\n\n<p>\u041e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \/etc\/fstab:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo echo \"remoute_user@server_name:\/dir\/ \/home\/local_user\/ruser fuse.sshfs defaults,_netdev,allow_other,reconnect,uid=1000,IdentityFile=\/home\/local_user\/.ssh\/id_rsa 0 0\" >> \/etc\/fstab<\/code><\/pre>\n\n\n\n<p>\u0427\u0442\u043e \u043c\u044b \u0443\u043a\u0430\u0437\u0430\u043b\u0438? \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 ssh, \u0430 \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 root, \u0442\u043e \u0438 \u0444\u0430\u0439\u043b \u043a\u043b\u044e\u0447\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043a\u0430\u0442\u044c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \/root\/.ssh\/, \u0430 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f local_user \u043a\u043b\u044e\u0447 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u0432 \u0435\u0433\u043e \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \/home\/local_user\/.ssh\/, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 ssh \u043a\u043b\u044e\u0447\u0438 \u0438 \u044f\u0432\u043d\u043e\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 (\u043d\u0435 root). uid=1000 &#8212; \u044d\u0442\u043e uid \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (local_user) \u043a\u043e\u043c\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043d\u0443\u0436\u043d\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f root \u2014 \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u0444\u0430\u0439\u043b \/root\/.ssh\/known_hosts.<\/p>\n\n\n\n<p>\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ ssh-keygen\n$ ssh-copy-id -i ~\/.ssh\/id_rsa.pub remoute_user@server_name<\/code><\/pre>\n\n\n\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438 \u0431\u0435\u0437 \u043f\u0430\u0440\u043e\u043b\u044f:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ ssh remoute_user@server_name<\/code><\/pre>\n\n\n\n<p>\u0438 \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 root:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># ssh -i \/home\/local_user\/.ssh\/id_rsa remoute_user@server_name<\/code><\/pre>\n\n\n\n<p>Fstab \u043d\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u043e\u0432 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0438 <a href=\"https:\/\/blog.airmeno.ru\/?p=1126\" data-type=\"URL\" data-id=\"https:\/\/blog.airmeno.ru\/?p=1126\">\u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b<\/a>.<\/p>\n\n\n\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e: <a href=\"https:\/\/wiki.archlinux.org\/index.php\/SSHFS_(%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)\">https:\/\/wiki.archlinux.org\/index.php\/SSHFS_(\u0420\u0443\u0441\u0441\u043a\u0438\u0439)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>FUSE (filesystem in userspace) &#8212; \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u044f\u0434\u0435\u0440 Unix-\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0431\u0435\u0437 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0439 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u042d\u0442\u043e \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u0441\u0447\u0451\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u0434\u0430 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,65],"tags":[114,115],"_links":{"self":[{"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=\/wp\/v2\/posts\/1139"}],"collection":[{"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1139"}],"version-history":[{"count":7,"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=\/wp\/v2\/posts\/1139\/revisions"}],"predecessor-version":[{"id":1147,"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=\/wp\/v2\/posts\/1139\/revisions\/1147"}],"wp:attachment":[{"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.airmeno.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}