LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 05-07-2010, 10:19 AM   #1
clozarks
LQ Newbie
 
Registered: Apr 2010
Posts: 16

Rep: Reputation: 0
Windows SMBFS Mount Permissions on Linux


Command used as root to mount a Windows 2003 server share to Linux Red Hat 4 x86-64 on Dell: mount -t smbfs -o username=user,workgroup=domain.edu,password=password //server.domain.edu/h$ /mnt/test

The mount is successful, but only root can write to the mount. How do I set the permissions on the mount to allow certain users read/write access to the share? I am logged on the Linux server as the same user who authenticated the mount. The user can read write on the Windows server share, but not while loggged into the Linux server.

Thank you,
Curt Swartzlander
DBA

Last edited by clozarks; 05-07-2010 at 10:21 AM. Reason: remove poll
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 05-07-2010, 11:37 AM   #2
ajeetsinghraina
Member
 
Registered: May 2010
Location: India
Distribution: Ubuntu 7.04/8.04/8.10/10.04, RHEL 6, OpenSUSE,Mandriva,Fedora, CentOS, XandrOS, Slackware, OpenSolar
Posts: 155

Rep: Reputation: 55
"...Hope these explanation clear your doubt."
Here it goes !!!

Providing Read/Write Access to the Share

Another problem with mounting the Windows share as permanently entered in the /etc/fstab file

Code:
//servername/sharename /mountdirectory smbfs username=windowsuserename,password=windowspassword 0 0
is that only the root user would have read/write access to the share. All other users would have read only access to it. If you wanted read/write access to it for yourself, you need to specify your userid or groupid. That would change the line in /etc/fstab to look like this:

//servername/sharename /mountdirectory smbfs credentials=/home/myhomedirectory/. smbpasswd,uid=mylinuxusername,gid=mylinuxgroupname 0 0

Whatever user and or group you specified in the line would have read/write access to the mounted share. You can use either the user or group name or the user or group numerical ID. Either should work.

If you had several users you wanted to have read/write access to it, create a group and add those users to the group. Then specify just that groupid in the /etc/fstab file. You wouldn't need to specify a userid. The line in etc/fstab would look like this:

//servername/sharename /mountdirectory smbfs credentials=/home/myhomedirectory/. smbpasswd,gid=sambausersgroup 0 0

You can see the man pages on smbmount, smbumount, mount, and fstab for more details.
 
2 members found this post helpful.
Old 05-07-2010, 11:54 AM   #3
clozarks
LQ Newbie
 
Registered: Apr 2010
Posts: 16

Original Poster
Rep: Reputation: 0
Thank you for the reply. If this mount is not permanent, but I only want to mount this as runtime and then remove the mount, can I still grant user permissions to write at runtime? Does the mount need to be in the /etc/fstab file?

Curt
 
Old 05-07-2010, 11:58 AM   #4
ajeetsinghraina
Member
 
Registered: May 2010
Location: India
Distribution: Ubuntu 7.04/8.04/8.10/10.04, RHEL 6, OpenSUSE,Mandriva,Fedora, CentOS, XandrOS, Slackware, OpenSolar
Posts: 155

Rep: Reputation: 55
No its not needed if you want to go with temporary entry.
Just run the same command on commandline terminal rather than storing it under /etc/fstab.
No difference at all.
 
1 members found this post helpful.
Old 05-07-2010, 01:10 PM   #5
clozarks
LQ Newbie
 
Registered: Apr 2010
Posts: 16

Original Poster
Rep: Reputation: 0
That did it! Adding the gid and uid to the command changed the permissions on the mount. Thank you for the help! One more question ... how long will the mount persist if I do not unmount? Will it persist until Linux server reboot? And does having a temporary mount (not in fstab) cause any issues (i.e. network performance) on the Linux server?

Thanks
Curt
 
Old 05-07-2010, 09:31 PM   #6
ajeetsinghraina
Member
 
Registered: May 2010
Location: India
Distribution: Ubuntu 7.04/8.04/8.10/10.04, RHEL 6, OpenSUSE,Mandriva,Fedora, CentOS, XandrOS, Slackware, OpenSolar
Posts: 155

Rep: Reputation: 55
Code:
how long will the mount persist if I do not unmount?
Until the next reboot

Code:
Will it persist until Linux server reboot?
Yes
Code:
And does having a temporary mount (not in fstab) cause any issues (i.e. network performance) on the Linux server?
No
 
1 members found this post helpful.
Old 05-10-2010, 09:50 AM   #7
clozarks
LQ Newbie
 
Registered: Apr 2010
Posts: 16

Original Poster
Rep: Reputation: 0
One other question ... I noticed that Red Hat Article 1984 "Can an NFS mount be shared out via samba under Red Hat Enterprise Linux?" that there may be issues with sharing a directory that is also an NFS mount point: "Red Hat does not recommend or support this type of configuration, where samba is used to re-export an NFS mounted file system.".

Can you confirm the way I have the smbfs mount point is not an issue? I do not know what re-exporting an NFS mounted file means, and I want to make sure that possible corruption is not a problem because of the way I have the Windows file system mounted on Linux.

Thank you,
Curt
 
Old 05-10-2010, 11:33 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Basically, there is more than one way of sharing a dir, including nfs & Samba. That quote just means that you should decide on one method and not try to simultaneously share it via nfs & Samba. Check your /etc/exports file for your nfs shares (on the server).
 
1 members found this post helpful.
  


Reply

Tags
linux, mount, samba



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
mount -t cifs permission denied by mount -t smbfs works fine humbletech99 Linux - Server 13 09-03-2009 10:17 AM
using smbfs to mount windows share snowman81 Linux - Software 4 04-23-2008 05:28 AM
help please: mount -t smbfs -a fails as normal user, as root, doesn't mount anything thevic Linux - Networking 11 04-09-2007 03:09 AM
Permissions and smbfs mounts kitanokikori Linux - Networking 2 11-11-2004 09:01 AM
mount -t smbfs let's dissapear /mnt/MyMount share in Linux hc2469 Linux - General 0 08-30-2004 06:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:31 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
Open Source Consulting | Domain Registration