LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   SAMBA problem ?? rebuilding server ?? How to configure SAMBA share with writing - Win (http://www.linuxquestions.org/questions/linux-newbie-8/samba-problem-%E2-rebuilding-server-%E2-how-to-configure-samba-share-with-writing-win-937699/)

Alvin88 04-02-2012 11:29 AM

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.

Sydney 04-02-2012 12:23 PM

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

chrism01 04-02-2012 06:23 PM

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

Alvin88 04-03-2012 05:00 AM

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?

Alvin88 04-03-2012 05:23 AM

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...

chrism01 04-04-2012 12:51 AM

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/


All times are GMT -5. The time now is 04:16 AM.