Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: mounted folder disappear as user and accessible only as root

  1. #1

    Default mounted folder disappear as user and accessible only as root

    on my Laptop=Dell latitude E6510, RAM=8Gb, GPU=GT218 NVS 3100M, CPU=i7 Q 720 @ 1.60GHz running opensuse leap 42.3, plasma 5.10.5, KDE frameworks 5.37.0, KDE applications 17.08.0, Kernel 4.4.79-19-default, nvidia drivers.
    In the past I mounted successfully an external AFS filesystem on a folder inserting in /etc/fstab this:
    Code:
    sshfs#myname@cresco-in.server.mycompany.it:/afs/.mycompany.it/ /afspla2 fuse user,noauto,fsname=sshfs#myname@cresco-in.server.mycompany.it:/afs/.mycompany.it/ 0 0
    and, I don't remember why, but I was able to access with dolphin /afspla2 as user.
    now I inserted the same in etc/fstab and it works but I can access /afspla2 with dolphin only as root, opening dolphin as user /afspla2 disappear and is non accessible.
    I tried to change ownership of /afspla2 to user=pla group=users but fail
    I tried to mount in /home/pla/afspla2 but fail
    the same happen mounting another filesystem like this:
    Code:
    sshfs procuste@192.168.1.2:/ /server/
    how can I have my external filesystem monted in my folders accessible as user??

  2. #2
    Join Date
    Oct 2008
    Location
    Glasgow, Scotland
    Posts
    1,131

    Default Re: mounted folder disappear as user and accessible only as root

    This is a laptop. You probably use Network Manager and a wireless connection. There will be no network (or sshfs possibility) until some rime after user login.

    The fstab entry will provide the mount parameters for a subsequent mount command. Attempts to use it to automunt will belong to root, but I do not fully understand the parameters you are using. Why not forget fstab and create an entry in "~/.config/autostart" or "~/.config/autostart-scripts" to perform the mount (you may need to include a short "sleep")? I would create a .desktop to provide a trivial graphical mount, and probably open Konsole in the mounted folder.

    My clients tend to only work in a graphical environment, so their laptop workspaces are provided with a Dolphin "Place" with an ssh link to their Documents folder in the office. They do not need anything else.
    ~Thank you for sharing an interesting problem.
    --
    slàinte mhath,
    rayH

  3. #3

    Default Re: mounted folder disappear as user and accessible only as root

    Quote Originally Posted by eng-int View Post
    This is a laptop. You probably use Network Manager and a wireless connection. There will be no network (or sshfs possibility) until some rime after user login.
    yes I use network manager but the network exist


    Quote Originally Posted by eng-int View Post
    The fstab entry will provide the mount parameters for a subsequent mount command.
    yes, I put it in fstab to have the possibility to mount with command as root mount /afspla2 and then I would like access with dolphin as user (as root with dolphin is ok), in the past it worked, but now the /afspla2 folder once mounted disappear and is not accessible in dolphin as user that says that it doesn't exist.
    Quote Originally Posted by eng-int View Post
    Attempts to use it to automunt will belong to root, but I do not fully understand the parameters you are using. Why not forget fstab and create an entry in "~/.config/autostart" or "~/.config/autostart-scripts" to perform the mount (you may need to include a short "sleep")? I would create a .desktop to provide a trivial graphical mount, and probably open Konsole in the mounted folder.
    I don't want automount, but the mount as root works, I cannot access as user

    Quote Originally Posted by eng-int View Post
    My clients tend to only work in a graphical environment, so their laptop workspaces are provided with a Dolphin "Place" with an ssh link to their Documents folder in the office. They do not need anything else.
    me too only grphical mode, yes, me too in my server with sftp and without password with this in dolphin
    Code:
    sftp://procuste@192.168.1.2/
    ,
    but with afs in my company it is not enough, it seems that this in fstab
    Code:
    sshfs#myname@cresco-in.server.mycompany.it:/afs/.mycompany.it/ /afspla2 fuse user,noauto,fsname=sshfs#myname@cresco-in.server.mycompany.it:/afs/.mycompany.it/ 0 0
    is needed in order to mount and I don't know how to do the same I do in my server in dolphin with sftp:// with ssh...

  4. #4
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    15,657

    Default Re: mounted folder disappear as user and accessible only as root

    Network may not exist until user logon unless you set NM to allow all users in which case it is established earlier in the boot

  5. #5

    Default Re: mounted folder disappear as user and accessible only as root

    Quote Originally Posted by gogalthorp View Post
    Network may not exist until user logon unless you set NM to allow all users in which case it is established earlier in the boot
    yes it is allowed for all users, ...but, why does network should be implied in this issue, I can mount as root with command mount /afspla2, but, after /afspla2 is mounted I can only access as root and I would like to access to it as user...

  6. #6

    Default Re: mounted folder disappear as user and accessible only as root

    well, with
    Code:
    sftp://myname@cresco-in.server.mycompany.it:/afs/
    I can have access as user, ...but why the mounted folder is inaccessible as user but only as root??

  7. #7
    Join Date
    Sep 2008
    Posts
    2,997

    Default Re: mounted folder disappear as user and accessible only as root

    I haven't tested it on a network share but I think a polkit setting should allow ordinary users access to a folder
    create the file /etc/polkit-1/rules.d/10-udisks2.rules
    and paste
    Code:
    // See the polkit(8) man page for more information
    // about configuring polkit.
    
    // Allow udisks2 to mount devices without authentication
    // for users in the "users" group.
    polkit.addRule(function(action, subject) {
        if ((action.id == "org.freedesktop.udisks2.filesystem-mount-system" ||
             action.id == "org.freedesktop.udisks2.filesystem-mount") &&
        subject.isInGroup("users")) {
            return polkit.Result.YES;
        }
    });
    you can change the users group to something more restrictive (create a new group and add yourself to it to prevent other users access to your share)
    some more info about polkit and opensuse
    https://doc.opensuse.org/documentati...policykit.html

  8. #8

    Default Re: mounted folder disappear as user and accessible only as root

    [QUOTE=I_A;2836556]I haven't tested it on a network share but I think a polkit setting should allow ordinary users access to a folder
    create the file /etc/polkit-1/rules.d/10-udisks2.rules
    and paste
    Code:
    // See the polkit(8) man page for more information
    // about configuring polkit.
    
    // Allow udisks2 to mount devices without authentication
    // for users in the "users" group.
    polkit.addRule(function(action, subject) {
        if ((action.id == "org.freedesktop.udisks2.filesystem-mount-system" ||
             action.id == "org.freedesktop.udisks2.filesystem-mount") &&
        subject.isInGroup("users")) {
            return polkit.Result.YES;
        }
    });
    manythanks, it works , but I cannot umount as user
    Code:
    pla@pla-3-TW:~> mount /home/pla/afspla2
    myname@cresco-in.mycompany.it's password: 
    pla@pla-3-TW:~> umount /home/pla/afspla2
    umount: /home/pla/afspla2: Permission denied
    pla@pla-3-TW:~>
    Quote Originally Posted by I_A View Post
    you can change the users group to something more restrictive (create a new group and add yourself to it to prevent other users access to your share)
    some more info about polkit and opensuse
    https://doc.opensuse.org/documentati...policykit.html
    ...I don't need more restrictive policy :-)
    ...reading your link I tried to do this:
    I created a file /etc/polkit-1/rules.d/10-udisks2-umount-pla-2017.rules wit this inside:
    Code:
    // See the polkit(8) man page for more information
    // about configuring polkit.
    
    // Allow udisks2 to unmount devices without authentication
    // for users in the "users" group. fatta da me 2017-09-03set
    polkit.addRule(function(action, subject) {
        if ((action.id == "org.freedesktop.udisks2.filesystem-mount-other-seat" ||
             action.id == "org.freedesktop.udisks2.filesystem-unmount-others") &&
        subject.isInGroup("users")) {
            return polkit.Result.YES;
        }
    });
    with this org.freedesktop.udisks2.filesystem-mount-other-seat and this org.freedesktop.udisks2.filesystem-unmount-others taken from
    Code:
    pla@pla-3-TW:~> pkaction | grep mount
    org.freedesktop.udisks2.filesystem-mount
    org.freedesktop.udisks2.filesystem-mount-other-seat
    org.freedesktop.udisks2.filesystem-mount-system
    org.freedesktop.udisks2.filesystem-unmount-others
    pla@pla-3-TW:~>
    but evidently I'm not enough skilled
    how can I umount as user what I mounted??

  9. #9
    Join Date
    Sep 2008
    Posts
    2,997

    Default Re: mounted folder disappear as user and accessible only as root

    about unmounting try adding the policy
    org.freedesktop.udisks2.filesystem-unmount-others http://storaged.org/doc/udisks2-api/...polkit-details
    modify the /etc/polkit-1/rules.d/10-udisks2.rules to read
    Code:
    // See the polkit(8) man page for more information
    // about configuring polkit.
    
    // Allow udisks2 to mount devices without authentication
    // for users in the "users" group.
    polkit.addRule(function(action, subject) {
        if ((action.id == "org.freedesktop.udisks2.filesystem-mount-system" ||
             action.id == "org.freedesktop.udisks2.filesystem-mount" ||
             action.id == "org.freedesktop.udisks2.filesystem-unmount-others") &&
        subject.isInGroup("users")) {
            return polkit.Result.YES;
        }
    });

  10. #10

    Default Re: mounted folder disappear as user and accessible only as root

    Quote Originally Posted by I_A View Post
    about unmounting try adding the policy
    org.freedesktop.udisks2.filesystem-unmount-others http://storaged.org/doc/udisks2-api/...polkit-details
    modify the /etc/polkit-1/rules.d/10-udisks2.rules to read
    Code:
    // See the polkit(8) man page for more information
    // about configuring polkit.
    
    // Allow udisks2 to mount devices without authentication
    // for users in the "users" group.
    polkit.addRule(function(action, subject) {
        if ((action.id == "org.freedesktop.udisks2.filesystem-mount-system" ||
             action.id == "org.freedesktop.udisks2.filesystem-mount" ||
             action.id == "org.freedesktop.udisks2.filesystem-unmount-others") &&
        subject.isInGroup("users")) {
            return polkit.Result.YES;
        }
    });
    ...it doesn't works, and the mounted folder cannot be unmounted neither as root
    Code:
    pla@pla-3-TW:~> mount /home/pla/afspla
    myname@cresco-in.mycompany.it's password: 
    pla@pla-3-TW:~> umount /home/pla/afspla
    umount: /home/pla/afspla: Permission denied
    pla@pla-3-TW:~> su
    Password: 
    pla-3-TW:/home/pla # /home/pla/afspla
    bash: /home/pla/afspla: Permission denied
    pla-3-TW:/home/pla #

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •