SSHFS: Difference between revisions

Onny (talk | contribs)
Add "see also" section
Raboof (talk | contribs)
'known hosts'
 
(7 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[https://github.com/libfuse/sshfs SSHFS] is a file system that allows users to mount and access remote files over SSH (Secure Shell) connections, providing secure and encrypted access to remote data.
[https://github.com/libfuse/sshfs SSHFS] is a [[Filesystems|file system]] that allows users to mount and access remote files over [[SSH]] (Secure Shell) connections, providing secure and encrypted access to remote data.
 
For more information on using SSHFS on NixOS, refer to {{NixOS Manual|name=NixOS Manual: Chapter - SSHFS File Systems|anchor=#sec-sshfs-file-systems}}.
 
You may want to connect to the machine 'interactively' once before configuring the connection declaratively, to add the remote key to your 'known hosts'.


== Configuration ==
== Configuration ==
Following example configuration will mount the remote filesystem <code>/mydata</code> of the host <code>10.0.1.100</code> at the destination <code>/mnt</code>. Authentication is done via the user <code>myuser</code> and the private key <code>/root/.ssh/id_rsa</code>.<syntaxhighlight lang="nix">
Following example configuration will mount the remote filesystem <code>/mydata</code> of the host <code>10.0.1.100</code> at the destination <code>/mnt</code>. Authentication is done via the user <code>myuser</code> and the private key <code>/root/.ssh/id_ed25519</code>.<syntaxhighlight lang="nix">
fileSystems."/mnt" = {
fileSystems."/mnt" = {
   device = "myuer@10.0.1.100:/mydata";
   device = "myuser@10.0.1.100:/mydata";
   fsType = "sshfs";
   fsType = "sshfs";
   options = [
   options = [
Line 10: Line 14:
     "noatime"
     "noatime"
     "allow_other"
     "allow_other"
     "IdentityFile=/root/.ssh/id_rsa"
     "IdentityFile=/root/.ssh/id_ed25519"
   ];
   ];
};
};
</syntaxhighlight>
</syntaxhighlight>{{Note|You will also need to enable SFTP on the server you are trying to connect to.}}


== See also ==
== See also ==


* [[Rclone]], which also supports mounting via SFTP. Possibly a more robost and stable implementation.
* [[Rclone]], which also supports mounting via SFTP. Possibly a more robust and stable implementation.


[[Category:Filesystem]]
[[Category:Filesystem]]
[[Category:Networking]]
[[Category:Networking]]