How to mount a remote directory using SSH to be available same as if it is a local directory?
|
|
|
First install the module:
Load it to kernel
Setting permissions
Now we’ll create a directory to mount the remote folder in. I chose to create it in my home directory and call it remoteDir.
Now I ran the command to mount it(mount on home).
Now it should be mounted
Enjoy |
|||||||||||||||||
|
|
Configure ssh key-based authentication Generate key pair on the local host.
Accept all sugestions with enter key. Copy public key to the remote host:
Install sshfs
Mount remote directory
Don't try to add remote fs to /etc/fstab Or don't try to mount shares via /etc/rc.local . In both cases it won't work as the network is not available when init reads /etc/fstab. Install AutoFS
Edit /etc/auto.master Comment out the following lines
Add a new line
Save and quit Edit /etc/auto.sshfs Add a new line
Remote user name is obligatory. Save and quit Start autofs in debug mode
Observe logs of the remote ssh server
Check content of the local directory You should see contents of the remote directory Start autofs in normal mode Stop AutoFS running in debug mode with CTRL-C . Start AutoFS in normal mode
Enjoy (Tested on Ubuntu 14.04) |
||||
|
|
|
Install sshfs
Add to fstab:
|
||||
|
|