LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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
 
LinkBack Search this Thread
Old 04-02-2012, 11:29 AM   #1
Alvin88
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Rep: Reputation: Disabled
SAMBA problem rebuilding server How to configure SAMBA share with writing - Win


I try to rebuild the Linux server CentoOS 6.2 with SAMBA, for the use of SAWMILL, and here is my problem:
I have installed the SAMBA server and create specific user for the purpose user logarchive and change the ownership of the directory / logarchive
As I am not very familiar with SAMBA I have done the configuration in the following way very lame way, I must say
1) copy the SAMBA config file from old server to the new one one file: /etc/samba/smb.conf
2) copy two files from old server to the new one - /var/lib/samba/private/*.*

At this point, I have tried to mount the drive under Windows, using the following command:
net use L: \\<IP ADDRESS>\logarchive aqqaqq /user:logarchive\logarchive
but I got the following error message:
###########################################################
Windows title: Location is not available

L:\ is not accessible.
Access is denied.
###########################################################

Although, I can see the free space and the total capacity of the disk, however I cannot see the files or browse through the directories...

Question: What else needs to be done, in order to copy files from Windows to this SAMBA share? I need to get some writing permission, but where? Which file is responsible for that?
This is not a problem with Windows, as this was perfectly fine with previous SAMBA server.

BTW:
Could you recommend a good book about SAMBA for this kind of exercise/job/task?
Or any good book about SAMBA, from beginning to let say, intermediate level.
 
Old 04-02-2012, 12:23 PM   #2
Sydney
Member
 
Registered: Mar 2012
Distribution: Scientific Linux
Posts: 147

Rep: Reputation: 36
It sounds like SELinux is enforce and your files are not in the samba context. If so run.
Code:
chcon -tR samba_share_t /path/to/samba/share
 
Old 04-02-2012, 06:23 PM   #3
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5
Posts: 16,086

Rep: Reputation: 1994Reputation: 1994Reputation: 1994Reputation: 1994Reputation: 1994Reputation: 1994Reputation: 1994Reputation: 1994Reputation: 1994Reputation: 1994Reputation: 1994
There's loads of docs at the samba home site here https://www.samba.org/; try also chap 28 http://www.techotopia.com/index.php/...x_6_Essentials
 
Old 04-03-2012, 05:00 AM   #4
Alvin88
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Original Poster
Rep: Reputation: Disabled
Many thanks for your help on this one.

I start with command like:
Code:
testparm /etc/samba/smb.conf
to double check the SAMBA config

Command:
Code:
setsebool -P samba_export_all_rw on
solve the problem which I had.

Command:
Code:
chcon -tR samba_share_t /path/to/samba/share
gave me an error:
Code:
chcon: cannot access `samba_share_t': No such file or directory
chcon: failed to change context of `/path/to/samba/share' to `unconfined_u:object_r:-R:s0': Invalid argument
not sure why is this.


This article here has a couple of interesting points about the SAMBA and SELinux...

Also this thread is helpful on this occasion

Many thanks for helping me out on that occasion....


I will mark this as solved - but maybe we can find a reason why I get this error with the command which user Sydney was kind to post.

Any suggestions?
 
Old 04-03-2012, 05:23 AM   #5
Alvin88
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Original Poster
Rep: Reputation: Disabled
Command:
Code:
chcon -tR samba_share_t /path/to/samba/share
should look like:
Code:
chcon -t samba_share_t -R /mnt/sawmill/logarchive/
In this version it works.

Hope that helps a bit....

Have a wonderful day...
 
Old 04-04-2012, 12:51 AM   #6
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5
Posts: 16,086

Rep: Reputation: 1994Reputation: 1994Reputation: 1994Reputation: 1994Reputation: 1994Reputation: 1994Reputation: 1994Reputation: 1994Reputation: 1994Reputation: 1994Reputation: 1994
Incidentally, chcon does not survive a reboot, so
Code:
semanage fcontext -a -t samba_share_t '/mnt/sawmill/logarchive/(/.*)?'
http://linux.die.net/man/8/semanage
http://www.unixpowered.com/unixpower...oubleshooting/
 
  


Reply

Tags
centos, samba config allow hosts, samba mount permission, samba permissions


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing to SAMBA share ok for Linux, not for Windows Jayel Linux - Server 2 09-28-2011 07:02 AM
[Samba] Samba as PDC stopped trusting my Win 7 clients after a server update martdj Linux - Networking 1 01-14-2011 10:30 AM
How do I mount a win-share on my debian-server using SAMBA Durham Linux - Server 3 01-17-2010 04:22 AM
How to edit files with xemacs over Samba share? Samba problem? rylan76 Linux - Software 1 11-13-2008 01:00 AM
Samba Share to Win XP Workgroup phr33k Linux - Server 4 03-19-2008 09:33 AM


All times are GMT -5. The time now is 02:20 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration