SSHFS: Difference between revisions

From XPUB & Lens-Based wiki
No edit summary
(Undo revision 202128 by Simon (talk))
Tag: Undo
Line 4: Line 4:
as long as you have an account in the remote machine.
as long as you have an account in the remote machine.


= Installing =
=Install=
==on Debian/Ubuntu==
sudo apt update
sudo apt install sshfs


== On Debian/Ubuntu ==
==on mac==
 
Use homebrew:
<syntaxhighlight lang="bash" line>
If homebrew is not installed run the installation command:
sudo apt update
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
sudo apt install sshfs
</syntaxhighlight>
 
== On Mac==
 
Use <code>homebrew</code>. If <code>homebrew</code> is not installed run the installation command:
 
<syntaxhighlight lang="bash">
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
</syntaxhighlight>


Once brew is installed, run:
Once brew is installed, run:
brew cask install osxfuse
brew install sshfs


<syntaxhighlight lang="bash" line>
brew cask install osxfuse
brew install sshfs
</syntaxhighlight>
= Mounting the Remote File System with SSHFS =
SSHFS command essential parameters:


<syntaxhighlight lang="bash">
=Mounting the Remote File System with sshfs=
sshfs user@host:remote_directory local_mount_directory   
sshfs command essential parameters:
</syntaxhighlight>
sshfs user@host:remote_directory local_mount_directory   


== How to mount ==
==How to mount:==
Create a directory in your local machine, to be use as a mount point
Create a directory in your local machine, to be use as a mount point
 
mkdir ~/remote
<syntaxhighlight lang="bash">
mkdir ~/remote
</syntaxhighlight>


Mount host remote directory onto the ~/remote directory
Mount host remote directory onto the ~/remote directory
ssh user@host:/full/path/to/remote/dir ~/remote


<syntaxhighlight lang="bash">
That's it
ssh user@host:/full/path/to/remote/dir ~/remote
</syntaxhighlight>
 
That's it :)


== How to unmount ==
==How to unmount==
To unmount the remote dir from the local directory we use the <code>umount</code> NOT '''unmount''', BUT '''umount'''
To unmount the remote dir from the local directory we use the <code>umount</code> NOT '''unmount''', BUT '''umount'''


<syntaxhighlight lang="bash">
umount ~/remote
umount ~/remote
</syntaxhighlight>


[[Category:Tools]]
[[Category:Cookbook]]

Revision as of 17:41, 14 November 2021

SSHFS (SSH Filesystem) is a filesystem client for mounting remote directories on your machine, using an SSH connection.

By using it you can access, read, edit files from a remote machine on your local machine, as long as you have an account in the remote machine.

Install

on Debian/Ubuntu

sudo apt update
sudo apt install sshfs

on mac

Use homebrew: If homebrew is not installed run the installation command:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Once brew is installed, run:

brew cask install osxfuse
brew install sshfs


Mounting the Remote File System with sshfs

sshfs command essential parameters:

sshfs user@host:remote_directory local_mount_directory  

How to mount:

Create a directory in your local machine, to be use as a mount point

mkdir ~/remote

Mount host remote directory onto the ~/remote directory

ssh user@host:/full/path/to/remote/dir ~/remote

That's it

How to unmount

To unmount the remote dir from the local directory we use the umount NOT unmount, BUT umount

umount ~/remote