To mount a network drive as a local one, you can use sshfs.
Generate SSH key
1
2
3
4
5
6
7
| $ mkdir ~/.ssh #if it does not already exist
$ chmod 700 ~/.ssh
$ cd ~/.ssh
$ ssh-keygen -t rsa
$ enter a keyname
$ enter a passphrase
$ ssh-copy-id -i [path to rsa file] USER@SERVER
|
Where -i
indicates where the rsa file is located. The .pub key is the one needed to be copied.
[Optional] Start a SSH agent, and add the key to the SSH agent:
1
2
| $ eval `ssh-agent -s` # if needed
$ ssh-add ~/.ssh/KEY.pub
|
Install sshfs
For Ubuntu:
For Mac:
Download both FUSE and SSHFS from here
Create a mounting point
1
2
3
4
5
| # Ubuntu
sudo mkdir /mnt/foo
# Mac
sudo mkdir /Volumes/foo
|
Connect to the remove server
1
2
3
4
5
| # Ubuntu
sudo sshfs USER@SERVER:/ /mnt/foo/ -o allow_other,IdentityFile=/home/USER/.ssh/SERVER_rsa
# Mac
sudo sshfs USER@SERVER:/ /Volumes/foo/ -o allow_other,IdentityFile=/home/USER/.ssh/SERVER_rsa,defer_permissions
|
Disconnect from the remove server
1
2
3
4
5
| # Ubuntu
sudo umount /mnt/foo
# Mac
sudo umount /Volumes/foo
|