0

I have 2 Debian systems, prod1 and prod2, with their respective users, prod1 and prod2 as well. I want to setup an sshfs with autofs to have a directory on prod1 in the /home/prod1/ that the user www-data could use independently on one server or the other. I want the owner of the content to be www-data. I want to use ssh from the prod2 user to prod1 user, not directly www-data. How would I configure /etc/fstab, /etc/auto.master and /etc/auto.sshfs ?

Bastian
  • 283
  • 3
  • 16
  • Look at this answer [-o allow_other](https://stackoverflow.com/questions/29330382/how-to-enable-writing-to-sshfs-directory-in-php) – Mikl Mar 17 '19 at 23:15

2 Answers2

1
cat /etc/fuse.conf 
# mount_max = 1000
# user_allow_other

Uncomment the user_allow_other line and then this will be work.

rojen
  • 111
  • 1
0

auto.master:

/mnt/ssh /etc/auto.sshfs        uid=www-data,gid=www-data,--timeout=30,--ghost

auto.sshfs:

prod1     -fstype=fuse,rw,nodev,nonempty,noatime,allow_other,max_read=65536 :sshfs\#prod1@prod1\:
  • you can use e.g. /var/www/ssh instead of /mnt/ssh, this directory becomes a special directory where access will trigger auto-mount ...
  • reconsider security implications and adjusting permissions

HTH, Zrin

Zrin
  • 607
  • 1
  • 6
  • 14
  • prod1 gets created automatically and belongs to root but then whatever I try to do (ls) returns No such file or directory – Bastian May 15 '12 at 10:27
  • make sure that root has needed private key in `/root/.ssh/id_dsa`, try `ssh prod1@prod1` from root – Zrin May 16 '12 at 03:50
  • sorry, tried all sorts of things and eventually gave up. sshing directly as www-data. Dunno what the etiquette says in this case but marking your answer as correct for your efforts. – Bastian May 16 '12 at 07:28