+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: how to mount an smb share as a normal user?

  1. #1

    how to mount an smb share as a normal user?

    I'd like to be able to network share as a normal user instead of having to mount it as root.
    Here's what I've tried so far after reading the man pages...

    1. chmod 4766 /usr/bin/smbmnt
    2. Added the following line in my /etc/fstab
    //kos/e$ /mnt/kos smbfs noauto,user,username=administrator 0 0

    * note that //kos/e$ is a partition on an NT box

    This is not working as I'm getting permission errors. However, if I su to root, I can do the following

    # mount -t smbfs -o username=administrator //kos/e$ /mnt/kos

    After putting in the password for the administrator account, the share is mounted.

    Hopefully someone hear can offer a solid way to get this done. Thanks in advance for any feedback

    Best,
    Adam

  2. #2

    Re: how to mount an smb share as a normal user?

    1. Set smbmount SUID (chmod +s /usr/bin/smbmount).
    or
    2. I'm not sure if it worked but I remember trying to use /home/me/myshare instead of /mnt/myshare.

  3. #3
    Moderator
    Good Guru
    Schotty's Avatar
    Join Date
    Jul 2001
    Location
    Milwaukee, WI
    Posts
    5,758

    Re: how to mount an smb share as a normal user?

    you must set the suid flags on smbmnt and smbunmount (I think /sbin/ in redhat). Once that is done, you can mount shares as a non root user. No way around that.

  4. #4
    Senior Member
    Join Date
    May 2001
    Posts
    411

    Re: how to mount an smb share as a normal user?

    Not sure about all distros, but I just mount Samba shares (on Windoze or LInux boxes) from /etc/fstab in Mandy and RedHat, like so:

    //other_box/share_name /local_mnt_pt smbfs username=you_know_who,password=you_know_what,fmask =0777

    Haven't tried adding the user option to the above line to enable the command

    mount /local_mnt_pt

    to work as user, but that might work. Let me know if it does.

    Also, if you do the above, change the permission on /etc/fstab to 600 so the unwashed don't see your passwords.

  5. #5

    Re: how to mount an smb share as a normal user?

    Lol! I'm such a twit. up till now, I didn't know you could mount smb shares, I've been using smbclient all this time

    This is great, mounting stuff will be so much better ;D

  6. #6
    Moderator
    Good Guru
    Schotty's Avatar
    Join Date
    Jul 2001
    Location
    Milwaukee, WI
    Posts
    5,758

    Re: how to mount an smb share as a normal user?

    The thing is that the fstab entries are being done as root any how. Just an easier way for dedicated mounts. For those that use LinNeighborhood to mount stuff as needed, the suid way may be easier (no screwing with the fstab file).


    Not sure about all distros, but I just mount Samba shares (on Windoze or LInux boxes) from /etc/fstab in Mandy and RedHat, like so:

    //other_box/share_name /local_mnt_pt smbfs username=you_know_who,password=you_know_what,fmask =0777

    Haven't tried adding the user option to the above line to enable the command

    mount /local_mnt_pt

    to work as user, but that might work. *Let me know if it does.

    Also, if you do the above, change the permission on /etc/fstab to 600 so the unwashed don't see your passwords.

  7. #7
    Senior Member
    Join Date
    May 2001
    Posts
    411

    Re: how to mount an smb share as a normal user?


    Lol! I'm such a twit. up till now, I didn't know you could mount smb shares, I've been using smbclient all this time

    This is great, mounting stuff will be so much better ;D
    Works for me. Once the share is mounted, you can forget about it. On some machines, say the gateway/firewall to your LAN, you might not want to do that if you have been a target of hackers. But if you've been a favourite hackee, then you've got other issues to worry about.

  8. #8

    Re: how to mount an smb share as a normal user?

    On some machines, say the gateway/firewall to your LAN, you might not want to do that if you have been a target of hackers. *But if you've been a favourite hackee, then you've got other issues to worry about.
    Well, can't say I've ever been hacked

    I just love being able to mount it as opposed to having to use smbclient. It's so great to be able to manipulate files on the other box with the familiar (and powerful) GNU tools, instead of being cramped into the crippled ftp-like interface of smbclient. Lets put it this way: it's really nice to be able to copy over multiple files at once with one command

  9. #9
    Senior Member
    Join Date
    May 2001
    Posts
    411

    Re: how to mount an smb share as a normal user?




    Well, can't say I've ever been hacked

    I just love being able to mount it as opposed to having to use smbclient. It's so great to be able to manipulate files on the other box with the familiar (and powerful) GNU tools, instead of being cramped into the crippled ftp-like interface of smbclient. Lets put it this way: it's really nice to be able to copy over multiple files at once with one command
    I'm on your team...

  10. #10

    Re: how to mount an smb share as a normal user?

    thanks to everyone for all the help. I was finally able to do this by following these steps

    chmod +s /usr/bin/smbmnt /usr/bin/smbmount
    mkdir ~/mnt

    added this line to /etc/fstab
    //server/share /home/me/mnt smbfs rw,noauto,user 0 0

    so now I'm able to mount it in a subdir within my home directory


+ Reply to Thread

Similar Threads

  1. problem with windows linux network
    By grooverider in forum Linux - Hardware, Networking & Security
    Replies: 0
    Last Post: 01-29-2005, 01:36 AM
  2. Create and Configure User Accounts in Windows XP
    By regix in forum Windows - General Topics
    Replies: 0
    Last Post: 01-04-2005, 07:48 AM
  3. Live Communications Server 2005 Glossary
    By regix in forum Windows - General Topics
    Replies: 0
    Last Post: 01-01-2005, 09:16 PM
  4. Samba Problem
    By turishi007 in forum Linux - General Topics
    Replies: 2
    Last Post: 10-17-2004, 04:32 AM
  5. MySQL user question
    By mcdougrs in forum Linux - Hardware, Networking & Security
    Replies: 3
    Last Post: 12-09-2002, 12:56 AM

Bookmarks

Posting Permissions

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