how to mount/umount folder with bindfs/fusermount from root account without privileges?

Asked by EDSON ARANTES D NASCIMENTO

This is my bash script into init.d:

#!/bin/bash
case "$1" in
  'start')
    # mount
    bindfs -n /home/my_user/.local/share/Cryptomator/mnt /home/my_user/drivefolder
 ;;
  'stop')
    fusermount -u /home/my_user/drivefolder
 ;;
  *)
    echo "Usage: $0 { start | stop }"
 ;;
esac
so i run it from root account:

/etc/init.d/drivemount.sh start
/etc/init.d/drivemount.sh stop
What I want is to mount/umount /home/my_user/drivefolder from root account to my_user account without privileges (so that the mounted folder can be manipulated without privileges).

is there any way to do this? (without having to run the script in my_user account without privileges and from another location)

Clarification: The script does not run automatically. What I want is to run the script manually, either from root or from my_user with sudo only from /etc/init.d location (for reasons unrelated to the question)

PD: I have read that with eval it can be done but I don't know.

<a href="https://packageslab.com/zong-internet-packages/">Zong Internet Packages</a>

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Bernard Stafford (bernard010) said (last edit ):
#1

Can you help with this problem?

Provide an answer of your own, or ask EDSON ARANTES D NASCIMENTO for more information if necessary.

To post a message you must log in.