I have two Cent OS 7 servers I am trying to mount a directory from my host server to my client server. I want this to automatically mount on boot.
On my host machine (hostmachine.local) I setup a user and gave that user sudo privileges.
On my client machine I setup an ssh key and associated it with the sudo user I created on my host machine. I then added the following to my /etc/fstab
file...
sshfs#sudouser@hostmachine.local:/var/www/vhosts /mnt/hostdir fuse _netdev,IdentityFile=~/.ssh/id_rsa,allow_other 0 0
When I reboot the machine it mounts and I can read the contents of the /var/www/vhosts
directory from the client (via /mnt/hostdir
), but when I try and write to the mounted directory I get a permission denied error.