Mount a ssh share

This is a post about mounting a ssh drive and a test post first i have published in a couple of years with the new WP. Also sshfs is now sadly unmaintained

Login to the share1 VM and create a folder to share and set the permissions to share it. We already have the user c0mputerking king created on the share1 VM and the webhost so fairly easy harder if you have to create a user as well with matching UID and GID should probably add that here too.

mkdir -p /zones/dataset-share1/fileshare/c0mputerking

chown c0mputerking:c0mputerking /zones/dataset-share1/fileshare/c0mputerking

Next login to the webhost to test with this command

sshfs c0mputerking@ /mnt/zones/dataset-share1/fileshare/c0mputerking

Generate some credentials on the client which is the webhost machine and the user you will be using c0mputerking in this case. Next copy the credentials to the share1 VM you need this to you can add a line to fstab on the client for mounting at boot time.

c0mputerking@webhost$ ssh-keygen

c0mputerking@webhost$ ssh-copy-id c0mputerking@

Add this to fstab on webhost

zimbra@ /mnt/zonesf/fileshare/c0mputerking fuse.sshfs allow_other,reconnect,IdentityFile=/home/c0mputerking/.ssh/id_rsa 0 0

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.