remoteshare Plugin and sshfs

  • Hi,


    I am using OMV since quite some time but I am new in this forum, so first of all: Hello to everybody and thanks for this nice peace of software!

    On my OMV Server i have the remoteshare plugin installed and some old forum posts indicate that sshfs would be supported.
    I can not find a section in the Web-GUI to configure a sshfs share. Looking into the source code on github
    shows something strange to me. A share type sshshare seems to be supported, but the JavaScript Sshfs.js is not included in the right place.


    My question is: What needs to be done to enable sshfs / sshshare in the Web-Gui or are there any good reasons not to use it with OMV?


    Thanks in advance

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • subzero79: Thank you, but I do have the testing repo enabled and dont see any upates:


    OMV-Etras Repos:



    Update manager settings:


    Update Manager (after Check-Buttom press):


    Available remoteshare Plugin 1.1:


    sources.list and installed plugins:




    Any ideas?

  • Did not help:



    Before uninstall:

    Code
    root@omv:~# apt-cache policy openmediavault-remoteshare
    openmediavault-remoteshare:
      Installiert:           1.1
      Installationskandidat: 1.1
      Versionstabelle:
     *** 1.1 0
            995 http://packages.omv-extras.org/debian/ stoneburner/main amd64 Packages
            100 /var/lib/dpkg/status


    After re-install:


    Code
    root@omv:~# apt-cache policy openmediavault-remoteshare
    openmediavault-remoteshare:
      Installiert:           1.1
      Installationskandidat: 1.1
      Versionstabelle:
     *** 1.1 0
            995 http://packages.omv-extras.org/debian/ stoneburner/main amd64 Packages
            100 /var/lib/dpkg/status


    It is not picking up a release of the remoteshare plugin in omv-extras.org-stoneburner-testing but is still using -stable


    This is a production system, so I hesitate to forcefully install from command line via


    Code
    apt-get -t  stoneburner-testing install remoteshare

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

    Einmal editiert, zuletzt von Zoki ()

  • Never mind.


    I wonder what the issue is:

    • From the comments it looks like it had been implemented in 2014
    • In the repository there is a file Sshfs.js
    • sshsahre seems is handled by the back-end

    Who is maintaining this plugin?
    -

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

    • Offizieller Beitrag

    I started work on it and removed it because it had too many issues. The plugin needs to be re-written. I have some ideas for it but it will be for OMV 3.x.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Here's a way to do it.


    1. OMV side
    - check the ssh service via the Web UI: Services » SSH: Enable
    - check/create the dir you want to be mounted remotely via ssh, with the wanted ACL (eg read/write/execute)
    - you need to add a bash login instead of pure shell or dash. Otherwise things like autocomplete or ctrl+r don't work. You can do that from the users management
    - add the user to sudo group or switch to root using su.
    - create a folder that you want for home and place the path in /etc/passwd in the the fifth field. Don't forget to chown the folder to the owner.
    - know the user ID (eg with `grep USER /etc/passwd` or `cd && ls -lan .` check the third column)


    2. Client side
    - check you have access to your OMV via ssh
    - optionally set up ssh key authentication (avoid the hassle to enter the password upon each ssh/fs access and mounting)
    - install sshfs
    - create the dir where you wanna mount the remote dir locally `mkdir /path/to/sshfs/server/dir`
    - mount it with `sshfs -o idmap=user,allow_other,uid=YOUR_UID,gid=YOUR_GID user@omv:/media/UUID/DIR /path/to/sshfs/server/dir -C` (tip: make an alias to mount it with eg `sshfs_omv`)


    The 'uid=,gid=' allows for rw access even if the user on the client has different uid and gid than on the OMV server
    Check it works (eg `ls /path/to/sshfs/server/dir/`)
    Unmount it : `fusermount -u /path/to/sshfs/server/dir`


    There might be other ways but that one just works.
    Edit: added the user $HOME steps to mount via ssh as a user (vs root).

  • @datruche Thank you for this little write up, but I needed it a bit different.


    May this be helpfull for others:


    My intention is to mount the file system of a remote server 'REMOTE-SERVER' into my local omv 'OMV' using the web gui and use it as if it was a omv share.


    It is not possible using the web gui so what I did instead is:

    • Create a new ssh key using the web gui
    • Add the public key to ~/.ssh/authorized_keys file on the remote server
    • Create a shared folder 'SSHFS' using the web gui
    • Log into OMV via command line
    • find the new ssh key in /var/lib/openmediavault/ssh/keys/openmediavault-1c69f786-25aa-4941-b5b6-4ef49514ec26
      (Finding the correct key can be a bit tricky, as the uuid will be different for every key, hint: check the comment)
    • Mount the remote server via sshfs -o idmap=user -o allow_other -o uid=YOUR_UID -o gid=YOUR_GID -o IdentityFile=PATH_TO_PRIVATE_KEY_FILE -o ServerAliveInterval=15 USER@REMOTE-SERVER:/PATH /media/UUID/SSHFS -C


    Advanced:

    • To have correct uid / gid in the file system, set up a user-id mapping file USER_MAPPING and group-id mapping file GROUP_MAPPING and use -o uidfile=USER_MAPPING and -g GROUP_MAPPING instead of -o uid=... and -g gid=...
    • To mount the remote file system on startup edit (as root) /etc/fstad and add a line
      sshfs#USER@REMOTE/SERVER:/PATH /media/UUID/sshfs fuse uid=YOUR_UID,gid=YOUR_GID,<other_options>,umask=0,allow_other,_netdev 0 0

    No you can use the remote servers file system like any shared folder

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!