VectorLinux
April 18, 2014, 11:07:40 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: Write access for non-root user on samba mounted share. [SOLVED]  (Read 4530 times)
dukefluke
Member
*
Posts: 31


« on: July 24, 2008, 10:04:58 pm »

I have setup my 5.9 standard gold system to mount a samba share on  a Vista Ultimate machine.
I have the share mounted at /media/smb with :

Code:
mount -t smbfs -o username=duke,password=xxx //vistamachine/Share /media/smb

If I use a terminal to cd to the share then I can create a file with something like:

Code:
touch somefile.txt

As long as I am root user. As my regular user (duke) I cannot write only read.
Before mounting at /media/smb I did:

Code:
chown duke smb

And after mounting and finding out I don't have write permission I tried:

Code:
chown -R duke smb

Which gave me a whole bunch of "Operation not Permitted" errors.

How can I give my regular user write access to samba mounts?
« Last Edit: July 25, 2008, 09:13:47 am by dukefluke » Logged
newt
Vectorian
****
Posts: 1132



« Reply #1 on: July 24, 2008, 10:52:27 pm »

It looks like by adding a userid or groupid to the -options you should be able to give writable permissions to non-root users.

Examples:
mount -t smbfs -o username=duke,password=xxx,uid=dukefluke //vistamachine/Share /media/smb
mount -t smbfs -o username=duke,password=xxx,gid=users //vistamachine/Share /media/smb

HTH!
newt
Logged
nightflier
Administrator
Vectorian
*****
Posts: 3941



« Reply #2 on: July 25, 2008, 05:40:44 am »

You can try mounting the share as user "duke" with smbmnt

On my machine I gave my regular user su power to the mount command, that way I can easily mount using cifs, which has some advantages over smbfs.
Logged
bigpaws
Vectorian
****
Posts: 1831


« Reply #3 on: July 25, 2008, 06:51:23 am »

The problem is that /media is root/root.

Change the /media/smb permissions to your username and
the group users.

Bigpaws
Logged
dukefluke
Member
*
Posts: 31


« Reply #4 on: July 25, 2008, 07:35:22 am »

Thank you everyone for your replies.

I tried smbmount(set suid on it) and while reading the man page for it I saw this:

Code:
WARNING:  smbmount  is deprecated and not maintained any longer.  mount.cifs (mount
       -t cifs) should be used instead of smbmount.

And I was like whoa! what is this cifs thing? I only ever used smbmount. So anyways rather than learn about
uid's and gid's right now(I'm lazy) I decide to use mount.cifs to mount in duke's home directory and that works fine.

Thanks again everyone. And thank you to the Vector linux team!   Cheesy


Logged
dukefluke
Member
*
Posts: 31


« Reply #5 on: July 25, 2008, 09:12:34 am »

Ok heres an update.

After mounting in my home dir with :

mount.cifs

I decided auto mounting would be nice so I went back to trying to mount in /media/smb: which I accomplished by editing my fstab and adding:

Code:
//vistamachine/Users /media/smb cifs exec,user=duke,password=xxx,uid=1000 0 0

I was able to determine my UID with :
Code:
id -u duke

and then "mount -a" bingo!

Thanks for the GID,UID,cifs info guys it got me on the right track!

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!