{"id":252,"date":"2006-11-13T10:46:18","date_gmt":"2006-11-13T09:46:18","guid":{"rendered":"http:\/\/www.alessandropagano.net\/alekoblog\/blog\/?p=252"},"modified":"2021-01-22T19:54:42","modified_gmt":"2021-01-22T18:54:42","slug":"shfs","status":"publish","type":"post","link":"https:\/\/alessandropagano.net\/blog\/shfs\/","title":{"rendered":"Montare un filesystem remoto con SSH"},"content":{"rendered":"<p style=\"text-align: center\"><strong>SHFS: Introduzione<\/strong><\/p>\n<p>OpenSSH \u00e8 un programma molto utile, sicuro e potente, l&#8217;uso principale che di solito ne viene fatto \u00e8 quello di entrare in macchine remote per amministrarle, chi lo usa spesso sapr\u00e0 che si possono copiare in maniera sicura file da un host all&#8217;altro, ma per un uso massiccio di questo protocollo la cosa non risulta troppo comoda. <!--more-->Mi capita spesso infatti che la mia macchina locale debba interagire con quella remota come se fossero la stessa cosa, e in questi casi scp non basta pi\u00f9. Ecco che ci viene in contro shfs, un modulo del kernel che ci permette di montare in maniera sicura filesystem remoti, permettendoci di utilizzare tutte le utility locali con dati remoti, come se fossero proprio sul nostro pc!<\/p>\n<p style=\"text-align: center\"><strong> SHFS: Installazione<\/strong><\/p>\n<p>Come al solito molto semplice:<\/p>\n<blockquote>\n<p>apt-get install shfs-source shfs-utils (installazione Debian, ma \u00e8 possibile scaricare i sorgenti da sourceforge)<\/p>\n<\/blockquote>\n<p>shfs-source \u00e8 il sorgente del modulo che dovremo compilare. shfs-utils sono i programmi per il mount e l&#8217;umount.<\/p>\n<p>compiliamo dunque shfs:<\/p>\n<blockquote>\n<p>cd \/usr\/src<br \/>\ntar xvjf shfs-source.tar.bz2<br \/>\nrm -f shfs-source.tar.bz2<br \/>\ncd modules\/shfs<br \/>\nmake &amp;&amp; make install<\/p>\n<\/blockquote>\n<p>Bene, abbiamo quasi finito.. carichiamo il modulo appena creato e vediamo come si possono montare\/smontare filesystem con ssh!<\/p>\n<blockquote>\n<p>modprobe shfs<br \/>\nmkdir \/mnt\/ssh<br \/>\nshfsmount aleko@192.168.10.2:\/home\/aleko \/mnt\/ssh<\/p>\n<\/blockquote>\n<blockquote>\n<p>Password:<\/p>\n<p>df -hT \/mnt\/ssh<\/p>\n<p>Filesystem Type Dimens. Usati Disp. Uso% Montato su aleko@192.168.10.2:\/home\/aleko shfs 1,4G 1,1G 195M 86% \/mnt\/ssh<\/p>\n<\/blockquote>\n<p>Per smontare si usa l&#8217;analogo:<\/p>\n<blockquote>\n<p>shfsumount \/mnt\/ssh<\/p>\n<\/blockquote>\n<p><strong><br \/>\nATTENZIONE: Per specificare la propria home directory non si pu\u00f2 usare il simbolo ~ che la contraddistingue, ma bisogna specificarla per intero.<\/strong><\/p>\n<p>Ovviamente, per un uso pi\u00f9 comodo, come tutti i filesystem da montare si pu\u00f2 editare \/etc\/fstab per automatizzare i mount abituali, ecco cosa e come aggiungere (ovviamente, sempre nel mio caso):<\/p>\n<p>aleko@192.168.10.2:\/home\/aleko \/mnt\/ssh shfs rw,user,noauto 0 0<\/p>\n<p>in questo modo baster\u00e0 un mount \/mnt\/ssh per montare il filesystem remoto!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SHFS: Introduzione OpenSSH \u00e8 un programma molto utile, sicuro e potente, l&#8217;uso principale che di solito ne viene fatto \u00e8 quello di entrare in macchine &#8230; <a title=\"Montare un filesystem remoto con SSH\" class=\"read-more\" href=\"https:\/\/alessandropagano.net\/blog\/shfs\/\" aria-label=\"More on Montare un filesystem remoto con SSH\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":4542,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[11,6,3],"tags":[18,19,15,20],"class_list":["post-252","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howto","category-linux","category-tecnologia","tag-filesystem","tag-filesystem-remoto","tag-linux","tag-ssh","infinite-scroll-item","masonry-post","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/alessandropagano.net\/blog\/wp-content\/uploads\/sites\/2\/2019\/06\/sshfs-feature-image.jpg?fit=800%2C343&ssl=1","uagb_featured_image_src":{"full":["https:\/\/i0.wp.com\/alessandropagano.net\/blog\/wp-content\/uploads\/sites\/2\/2019\/06\/sshfs-feature-image.jpg?fit=800%2C343&ssl=1",800,343,false],"thumbnail":["https:\/\/i0.wp.com\/alessandropagano.net\/blog\/wp-content\/uploads\/sites\/2\/2019\/06\/sshfs-feature-image.jpg?resize=150%2C150&ssl=1",150,150,true],"medium":["https:\/\/i0.wp.com\/alessandropagano.net\/blog\/wp-content\/uploads\/sites\/2\/2019\/06\/sshfs-feature-image.jpg?fit=300%2C129&ssl=1",300,129,true],"medium_large":["https:\/\/i0.wp.com\/alessandropagano.net\/blog\/wp-content\/uploads\/sites\/2\/2019\/06\/sshfs-feature-image.jpg?fit=768%2C329&ssl=1",768,329,true],"large":["https:\/\/i0.wp.com\/alessandropagano.net\/blog\/wp-content\/uploads\/sites\/2\/2019\/06\/sshfs-feature-image.jpg?fit=800%2C343&ssl=1",800,343,true],"1536x1536":["https:\/\/i0.wp.com\/alessandropagano.net\/blog\/wp-content\/uploads\/sites\/2\/2019\/06\/sshfs-feature-image.jpg?fit=800%2C343&ssl=1",800,343,true],"2048x2048":["https:\/\/i0.wp.com\/alessandropagano.net\/blog\/wp-content\/uploads\/sites\/2\/2019\/06\/sshfs-feature-image.jpg?fit=800%2C343&ssl=1",800,343,true],"trp-custom-language-flag":["https:\/\/i0.wp.com\/alessandropagano.net\/blog\/wp-content\/uploads\/sites\/2\/2019\/06\/sshfs-feature-image.jpg?fit=18%2C8&ssl=1",18,8,true]},"uagb_author_info":{"display_name":"aleko","author_link":"https:\/\/alessandropagano.net\/blog\/author\/aleko\/"},"uagb_comment_info":0,"uagb_excerpt":"SHFS: Introduzione OpenSSH \u00e8 un programma molto utile, sicuro e potente, l&#8217;uso principale che di solito ne viene fatto \u00e8 quello di entrare in macchine ... Read more","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/alessandropagano.net\/blog\/wp-json\/wp\/v2\/posts\/252","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alessandropagano.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alessandropagano.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alessandropagano.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alessandropagano.net\/blog\/wp-json\/wp\/v2\/comments?post=252"}],"version-history":[{"count":0,"href":"https:\/\/alessandropagano.net\/blog\/wp-json\/wp\/v2\/posts\/252\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/alessandropagano.net\/blog\/wp-json\/wp\/v2\/media\/4542"}],"wp:attachment":[{"href":"https:\/\/alessandropagano.net\/blog\/wp-json\/wp\/v2\/media?parent=252"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alessandropagano.net\/blog\/wp-json\/wp\/v2\/categories?post=252"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alessandropagano.net\/blog\/wp-json\/wp\/v2\/tags?post=252"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}