As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/

Linux - $ mount computer:/folder1/folder2 /home/user/folder ---- "only root can do that"

JamesKeenanJamesKeenan Registered User regular
edited August 2013 in Help / Advice Forum
So this isn't exactly standard fare, but I'm trying to find an answer, and I'm googling, but nothing quite yet has solved the issue. I know plenty of people on here are quite savvy. Maybe they're able/willing/present to help?

It's a network samba share, I just want to be able for me and other users to be able to mount to their home directories.

I'm googling and reading the man page for mount, but I'm just not up to snuff to be able to make sense of it yet. Anyone able to help?

sudo isn't working, and I'm worried of breaking something if I start messing with /etc/fstab before I know what I'm doing. /sbin/mount.cifs is set to -rwsr-xr-x. These are the things I've found to try so far, but haven't worked.

JamesKeenan on

Posts

  • azith28azith28 Registered User regular
    maybe this is a silly question but are you running the command as the root user? Sudo is probably ment to be run by the root (superuser) because root can run anybodies stuff, but running sudo as a non-superuser is unlikely to work, and the mount command itself is very likely root owned. if you have the root password, switch users (su command), then run your mount.

    Stercus, Stercus, Stercus, Morituri Sum
  • JamesKeenanJamesKeenan Registered User regular
    edited August 2013
    I'm trying to get the mount command to be usable by non-root users. I can absolutely mount the network share as the root user, and it's not that immediate of an issue, because for the user in question I just made his directory in his home folder and mounted when he needed there for him, but it isn't really a permanent solution. I'm trying to allow non-superusers the ability to mount. I'd rather not be giving out the root password, even though where I work I actually trust pretty much everyone not to break anything. In reality, many of them may be more competent than me at this point where Linux is concerned.

    JamesKeenan on
  • bowenbowen How you doin'? Registered User regular
    Keep in mind, su and mounting a directory will likely cause a whole lot of permissions errors if you try to write to the mounted share.

    fstab should fix the issue.

    You'll probably want to look more at this, I'm guessing part of the problem is the computer:/ part of that.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • JamesKeenanJamesKeenan Registered User regular
    edited August 2013
    bowen wrote: »
    Keep in mind, su and mounting a directory will likely cause a whole lot of permissions errors if you try to write to the mounted share.

    fstab should fix the issue.

    You'll probably want to look more at this, I'm guessing part of the problem is the computer:/ part of that.

    That did it. My fstab entry had to differ from the mount command I was using as root. The computer:/ works for a mount command, just not as the fstab entry to allow users to mount files. I ended up with

    //computer1/shareddirectory /export/folder cifs guest,user 0 0

    And that works.

    Thank you. It's not the most elegant, but it at least solves this one problem.

    JamesKeenan on
  • azith28azith28 Registered User regular
    I'm trying to get the mount command to be usable by non-root users. I can absolutely mount the network share as the root user, and it's not that immediate of an issue, because for the user in question I just made his directory in his home folder and mounted when he needed there for him, but it isn't really a permanent solution. I'm trying to allow non-superusers the ability to mount. I'd rather not be giving out the root password, even though where I work I actually trust pretty much everyone not to break anything. In reality, many of them may be more competent than me at this point where Linux is concerned.

    Well, you shouldnt have to give out the root password, there are a few alternatives.

    1) setup the user profile to mount the systems on login.
    2) create a script /binary that is runable by any user with root access, BUT only does specific things , maybe via an argument call.
    3) Do it manually on a once per system during setup so it mounts during bootup (fstab/mtab), and the user doesnt have to be involved at all.

    Stercus, Stercus, Stercus, Morituri Sum
  • JamesKeenanJamesKeenan Registered User regular
    azith28 wrote: »
    I'm trying to get the mount command to be usable by non-root users. I can absolutely mount the network share as the root user, and it's not that immediate of an issue, because for the user in question I just made his directory in his home folder and mounted when he needed there for him, but it isn't really a permanent solution. I'm trying to allow non-superusers the ability to mount. I'd rather not be giving out the root password, even though where I work I actually trust pretty much everyone not to break anything. In reality, many of them may be more competent than me at this point where Linux is concerned.

    Well, you shouldnt have to give out the root password, there are a few alternatives.

    1) setup the user profile to mount the systems on login.
    2) create a script /binary that is runable by any user with root access, BUT only does specific things , maybe via an argument call.
    3) Do it manually on a once per system during setup so it mounts during bootup (fstab/mtab), and the user doesnt have to be involved at all.

    I ended up doing #3.

Sign In or Register to comment.