LOGO

Mount Remote Folder via SSH on Ubuntu - A Step-by-Step Guide

December 14, 2006
Mount Remote Folder via SSH on Ubuntu - A Step-by-Step Guide

Securely Accessing Remote Files with SSHFS

Utilizing SSH provides a significantly more secure method for connecting to servers over the internet. A convenient technique involves mounting a folder from a remote server directly onto your local system using the SSHFS service.

The process requires several steps, so prepare to work within a terminal window.

Installation and Module Loading

Initially, the SSHFS module needs to be installed. This is achieved with the following command:

sudo apt-get install sshfs

Following installation, the module must be loaded into the kernel using modprobe:

sudo modprobe fuse

Permissions Configuration

Proper permissions are essential for accessing the necessary utilities. The following commands should be executed, remembering to substitute with your actual username.

sudo adduser fuse

sudo chown root:fuse /dev/fuse

sudo chmod +x /dev/fusermount

After adding yourself to the 'fuse' group, a logout and subsequent login are required for the changes to take effect.

Mounting the Remote Folder

A local directory will now be created to serve as the mount point for the remote folder. In this example, a directory named 'remoteserv' is created within the user's home directory.

mkdir ~/remoteserv

The core mounting command is then executed. You will be prompted to confirm the server's key and enter your remote server password.

sshfs @:/remotepath ~/remoteserv

Verification and Usage

Once the command completes successfully, you can navigate into the newly mounted directory. It will behave as if it were a local folder.

geek@ubuntuServ:~/remoteserv$ ls -l

total 16

drwxr-xr-x 1 951247 155725 4096 2006-12-13 13:30 howtogeek.com

drwxr-sr-x 1 root root 4096 2006-09-11 06:45 logs

drwx------ 1 951247 155725 4096 2006-08-11 16:09 Maildir

drwxrwxr-x 1 951247 155725 4096 2006-10-29 02:34 scripts

The output of the 'ls -l' command confirms that the remote files and directories are now accessible locally.

#Ubuntu#SSH#mount#remote folder#file access#SSHFS