LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-27-2004, 11:45 PM   #1
xerogravity
LQ Newbie
 
Registered: Aug 2004
Distribution: mandrake 10
Posts: 2

Rep: Reputation: 0
How do I mount a samba directory with write permissions?


I have a samba server sharing my home directory. Works great using windows having read and write permissions. When I mount this samba directory using Mandrake 10.0, I only have read permissions. I have to use root to write. I have done 'chown user:group /mount/point' however after I mount it, root is the owner. How can I have my user have read/write permissions to this samba mount?
 
Old 08-28-2004, 03:19 AM   #2
dimi
Member
 
Registered: May 2003
Location: Sydney, Australia
Distribution: Debian
Posts: 67

Rep: Reputation: 15
have a look at the fmask and dmask in smbmount man page. These should do the trick. Al
 
Old 08-28-2004, 04:59 AM   #3
legolin
Member
 
Registered: Dec 2003
Location: munich
Distribution: Fedora Core 4
Posts: 141

Rep: Reputation: 15
have you tryied to install swat?

it is great! you can manage your samba config with mozilla. there is an option, where you can change it.

very easy, just loock in your system, if you have swat installed or not. if not, google swat samba and you'll get it


hope you like it,


leg
 
Old 08-29-2004, 12:52 PM   #4
motub
Senior Member
 
Registered: Sep 2003
Location: The Netherlands
Distribution: Gentoo (main); SuSE 9.3 (fallback)
Posts: 1,607

Rep: Reputation: 46
If you're mounting the directory via /etc/fstab at boot, which it seems like you are, you need to change the mount setting sin /etc/fstab to give ownership and read write permissions to the users of your choice. Mounts made in /etc/fstab are automatically owned by root and the root group (the permissions of the mount point will change when the partition is mounted), and "others" (which is you if you are not root, nor a member of the root group, which you should not be) will only have read privileges if they have any privileges at all. Definitely not write.

I don't mount samba shares in /etc/fstab, so I don't know the protocol for changing the permissions-- I figure that dimi is probably right on the money pointing you to fmask and dmask in smbmount man page, though.

Hope this helps.
 
Old 09-01-2004, 02:38 PM   #5
xerogravity
LQ Newbie
 
Registered: Aug 2004
Distribution: mandrake 10
Posts: 2

Original Poster
Rep: Reputation: 0
Thank you muchly. I added the options to fstab and things are working well. I have one problem left.
The permissions on the server are talking effect on the client. I have read/write permissions in the mount folder however all the files inside are owned by 503:503. The uid and gid of the user on the server that I'm logging in as. On Windows, things work seamlessly if you sync your login info with the server. Do I have to do this with Linux as well? If so, is user:group good enough or sync the user ID and group ID as well? On the other hand, using Windows, if I map the drive with another username, I have read/write permissions. Why isn't it the same with Linux?
 
Old 12-03-2004, 08:01 PM   #6
jeopardyracing
Member
 
Registered: Sep 2003
Posts: 175

Rep: Reputation: 30
Resolution?

I am having the identical problem: different UID on server (Mac OS X , Samba) is being honored by Knoppix client. Did you find a solution?

Even though I specify the username in the fstab entry, only resources with "other" permissions can be read or written on the Mac.

I strongly suspect the following is the reason: while the username is the same on both machines, my primary username = UID 1000 in Knoppix but UID 501 on the Mac! I think that when I am logged in as root in KNoppix this distinction doesn't matter, but when when I am in the user account, the Knoppix PC isn't concerned that the username is the same on the Mac's files, it looks at the numeric UID and bases its permissions on that, despite my having dmask=777 and fmask=777 in the fstab entry. Any ideas as to why my dmask and fmask aren't working?
 
Old 12-04-2004, 04:53 PM   #7
fortezza
Member
 
Registered: Mar 2003
Location: Colorado
Distribution: Fedora Core 4
Posts: 297

Rep: Reputation: 30
I stopped using Samba for Linux to Linux network file shares, what I do is share the same folder using both NFS and Samba , with NFS used by my Linux boxes and Samba used by any Windows box I happen to bring home ( usually work laptop ). Here is what I used back in the day when I mounted an SMB share on my Linux box ( this is fstab style ):
//<servername>/<sharename> /mnt/<mount folder> smbfs username=<remote user>,password=<remote users password pwd>,uid=<localuser>,gid=<local group id>,umask=0,rw ,user 0 0

Command Line Style:
mount -t smbfs -o username=<remote user>,password=<remote users password pwd>,uid=<localuser>,gid=<local group id>,umask=0,rw //<servername>/<sharename> /mnt/<mount folder>


Where remote user is the name of a user on the box that is sharing the folder ( e.g. hosting the share ),and the remote password is that users corresponding password, the uid/gid is the username/groupname on the box you are mounting the share one, and will be listed as the owner/group after the share is mounted. umask sets default perms to 777 for new files, and rw specifies both read and write ops are allowed through the mounted share.
"user" means the mount point is mountable by any user on the computer where the mount point is, however, you have to suid the "smbmnt" like so "chmod+s /usr/sbin/smbmnt" for it to work.

Hopefully this helps you out.
 
Old 12-05-2004, 02:43 PM   #8
jeopardyracing
Member
 
Registered: Sep 2003
Posts: 175

Rep: Reputation: 30
Thanks!

I'll give that syntax a try!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba directory permissions - can't write from XP ajkrishock Linux - Networking 2 10-16-2005 01:56 PM
knoppix mount write permissions ext3 baird LinuxQuestions.org Member Success Stories 1 12-20-2004 02:59 PM
Mount directory permissions Joe47 Fedora 2 07-13-2004 01:13 AM
How do I change read/write permissions for a whole directory? Stevetgn Linux - Newbie 8 12-31-2003 08:41 AM
write permissions for directory - not accidently move/deleted the directory linuxgamer Linux - Newbie 10 12-02-2003 04:04 AM


All times are GMT -5. The time now is 07:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration