Secure Shell Managing remote files through ssh Mounting remote directory through ssh

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

You can mount remote directory through ssh by using sshfs. Sshfs does not come as a default on Ubuntu, so you need to install it first by using sudo apt-get install sshfs. You can then mount the remote directory to your local machine like this

sshfs [email protected]:/remotedir /localdir

Note that the localdir needs to be present before trying to mount the remotedir. In case that the localdir is not empty, sshfs will complain and abort. You can force it to mount in the non empty dir by using nonempty option like this

sshfs -o nonempty [email protected]:/remotedir /localdir

Once you umount the localdir, local files will become visible again.



Got any Secure Shell Question?