Create Share on Linux for windows

I have a linux server and four (4) windows machines. I want to share some files on Linux server to use on the windows clients. The Linux server has two hard drives. One was initialized and used as the primary drive.
I created a (SAMBA) folder share successfully which I was able to view and open on the windows machine. I noticed that my share was created in the home directory which is just 4GB and not enough for the files.
I formatted and initialized the second drive and created a share on it following the same instructions I used for folders shared in Home directory. unfortunately, I can only view the folder but cant open the folder.
I suspect it to be a permission issue but as a newbie I'm stuck.

Pls can anybody help me out?
bizdataAsked:
Who is Participating?
 
nociSoftware EngineerCommented:
So you did:  

chcon -t samba_share_t /media/Datastore1/Data

and now the directory shows?
command:  ls -Zd /media/Datastore1/Data
output:      system_u:object_r:samba_share_t /media/Datastore1/Data

Then this: ( to make the setting survive a reset on selinux)... (both commands).
  semanage fcontext -a -t samba_share_t "/media/Datastore1/Data(/.*)?"
  restorecon -R -v /media/Datastore1/Data/

And did you restart samba after this?

Or you can check selinux to permisive mode, then the violations get logged to the audit log and nothing else should happen wrt. to blocking access.
0
 
liddlerCommented:
have a look at the permissions for the folder, from the command line use ls -l or from the GUI, right click, go to properties and permissions is the third tab.
For some one to be able to open a folder, they need eXecute permissions.
a permission of:
drwxr--r--  will only allow the owner to open the folder
drwxr-xr-x will allow owner, group and everyone

Use chmod (http://linux.die.net/man/1/chmod) to update permissions
0
 
nociSoftware EngineerCommented:
Besides the protection, also the username & group are shown in ls -l...
or in a gui. Down forget those to take into account,

chown user:group ....
Can be used to change those.
http://linux.die.net/man/1/chown
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
vaderjCommented:
If you are still having issues with perms, post your smb.conf - there can be user perms setting in there also
0
 
bizdataAuthor Commented:
The permission on the 'Data' folder is drwxrwxrwx.  Every settings are the same with the 'Share ' folder, except for the location of the folders. 'Data' folder is on another drive on the server while 'Share' folder is in the /home directory. I can open the 'Share' folder on my windows machine but can not open the 'Data' folder on windows machine.

Below is the SMB.conf file:

 
[global]
  workgroup= mynetwork
  netbios name= linuxserver
  security= user
  load printer = No
  default service= global
  path= /home
  available= No
  encrypt password= yes

  [share]
  writeable = yes
  browseable = yes
  admin users = Top
  path= /home/share
  force user = root
  valid users= Top1, Top2, Top3
  public= yes
  available= yes

  [Data]
  writeable = yes
  browseable = yes
  admin users = Top
  path= /media/Datastore1/Data
  force user = root
  valid users= Top1, Top2, Top3
  public= yes
  available= yes
0
 
nociSoftware EngineerCommented:
For the data you need at least execute access for /media & /media/Datastore1 for users Top1..3
Did you check the samba logging for any problems?

Another thought:
Did you activate SELinux? if it is disabled.. ok if it is enabled is it Permissive of Enforcing.
If it is Enforcing you need to check the audit logs for any problems.
(see /var/log/audit )
If it permissive als check if there are errors/warnings w.r.t. you files/shares.




0
 
bizdataAuthor Commented:
SELinux = Enforcing. I'm still reviewing the log but can't get any clue as to what the problem might be
0
 
nociSoftware EngineerCommented:
Do a tail -f of the log (the're be a ton of messages) ;-/

And see what messages get added when you try access, also check the samba logs.
0
 
bizdataAuthor Commented:
This is what I have in the smaba log:
 Samba-Log.txt


Thanks
0
 
nociSoftware EngineerCommented:
Ok
[2011/11/01 12:33:39.606734,  0] smbd/service.c:988(make_connection_snum)
  canonicalize_connect_path failed for service Data, path /media/Datastore1/Data
This message is caused by the selinux settings.
You might want to read the next manual page and apply the settings to you Data directory.
See for details:
http://linux.die.net/man/8/samba_selinux

Then the cups error, is cups running or not..? it looks like it..
if it is running it should allow access from localhost.
0
 
bizdataAuthor Commented:
noci

I'm sorry I'm a newbie. I tried to run chon -t at command line but returned error 'bash command not found'.

Thanks
0
 
nociSoftware EngineerCommented:
chon should have been chcon (change context).

0
 
bizdataAuthor Commented:
chcon -f

I followed that instructions on the SElinux policy but I'm still having the same problem. May be I need to start the samba server config all over from scratch. I attached the log for your review.

Thanks log-smbd.txt
0
 
nociSoftware EngineerCommented:
You can decide to disable samba selinux with:

 setsebool -P smbd_disable_trans 1

and restart the samba server.
0
 
nociSoftware EngineerCommented:
Selinux will continue to be used, except for samba.
0
 
bizdataAuthor Commented:
I had to change SElinux to permissive mode, restart and I was able to open the folder. Though, I will look into security of the folder later.

Thanks
0
 
nociSoftware EngineerCommented:
Now you will see the exact failure in /var/log/audit....
look for type AVC records, with avc:  denied
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.