LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-13-2015, 07:03 PM   #1
mixignal
LQ Newbie
 
Registered: Feb 2015
Posts: 4

Rep: Reputation: Disabled
Cannot write to a RHEL Samba share in Windows 8.1


I am trying to mount a Redhat local directory /local3/user1 which is owned by the user user1, in Windows 8.1 for read/write operation.
After successfully mounting the share in Windows 8.1, I can read the share in Windows but when I try to create a file in the shared folder I get an error window with the following error:

-----Error Start----
Destination Folder Access Denied
You need permission to perform this action
---- Error end ---------

I followed the steps from this link https://access.redhat.com/documentat...t_Servers.html

Also I have a similar share from a Debian Linux workstation and that works fine.

----- Here's the content of /etc/samba/smb.conf ------
[global]
workgroup = MSHOME
server string = %h server
#
log file = /var/log/samba/log.%m
max log size = 50
#
security = user
passdb backend = tdbsam
#

[user1]
comment = User1 share
path = /local3/user1
valid users = user1
public = no
writable = yes
printable = no
create mask = 0765

## I have omitted some of the printer/etc share info for brevity

----- End of content of smb.conf ------

Then I created the smb user with the following command

$sudo smbpasswd -a user1

And in Windows when I Map the drive I give the address:
\\[IP address\user1

and use samba credentials.

It is successfully mounted and I can read BUT I CANNOT WRITE to it.

Any help will greatly appreciated.

Thank You
 
Old 02-14-2015, 12:50 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,333

Rep: Reputation: Disabled
There are two sets of permissions involved here: The permissions on the SMB share object, and the permissions on the file system objects involved.

What are the permissions and ownership settings on the shared directory (/local3/user1)?
 
Old 02-14-2015, 07:06 PM   #3
mixignal
LQ Newbie
 
Registered: Feb 2015
Posts: 4

Original Poster
Rep: Reputation: Disabled
Permission for the linux SMB share

The permissions for /local3/srout is
drwxr-xr-x. 3 srout srout 4096 Feb 13 19:44 .

**NOTE** user1 is srout. I used user1 in the prblem statement to keep it generic.

I have a same permission in a debian system and that mounts R/W fine.

Do you see any issue there ?

Thanks for your response.
 
Old 02-14-2015, 08:55 PM   #4
zafar_dandoti
Member
 
Registered: Dec 2005
Location: India
Distribution: centos
Posts: 178

Rep: Reputation: 13
Did u set the selinux context accordingly.
Code:
chcon -t samba_share_t /path/to/share
If that works then add it permanantly
Code:
semanage fcontext -a -t samba_share_t /path/to/share
Code:
restorecon -R /path/to/share

Last edited by zafar_dandoti; 02-14-2015 at 08:59 PM.
 
Old 02-15-2015, 09:52 AM   #5
mixignal
LQ Newbie
 
Registered: Feb 2015
Posts: 4

Original Poster
Rep: Reputation: Disabled
[SOLVED] Works

SELinux change worked! Thanks a lot

One caveat, it seems like the existing folders/files in /local3/srout (the Samba share) are not writable from Windows, only the new ones. Not a big deal for me now but it will nice to get around that.

Also, never used SELinux in my life. If there's a good userguide/tutorial for it, please feel free to recommend.

Thanks again
 
Old 02-15-2015, 11:04 AM   #6
zafar_dandoti
Member
 
Registered: Dec 2005
Location: India
Distribution: centos
Posts: 178

Rep: Reputation: 13
Naviget to /local/srout directory and check the selinux file context are properly set(recursively) to all files and folder.
Code:
#ls -lZ
All files and directory should have context type to samba_share_t
 
Old 02-15-2015, 11:30 AM   #7
mixignal
LQ Newbie
 
Registered: Feb 2015
Posts: 4

Original Poster
Rep: Reputation: Disabled
was missing -R in chcon

Forgot to do recursive chcon (-R option).
Once I do that it's all fixed.

Thanks a lot again.
 
Old 02-15-2015, 12:02 PM   #8
zafar_dandoti
Member
 
Registered: Dec 2005
Location: India
Distribution: centos
Posts: 178

Rep: Reputation: 13
If u are satisfied with solution mark it as solved. Thank you!
 
  


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
[SOLVED] Samba share can't write in linux, can in Windows xmrkite Linux - Software 1 09-17-2012 12:14 PM
Can not write to Samba share from Windows williams402 Linux - Newbie 2 02-27-2007 03:49 PM
Why can I not write to a SAMBA share when read/write is enabled? eric m Linux - General 4 08-21-2006 09:22 PM
Can't write to Samba share from Windows Needlotsahelp Linux - Newbie 3 07-30-2005 08:32 PM
can't write to VFAT samba share from WIndows dvanaken Linux - Software 3 05-13-2003 05:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:28 AM.

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