?
Solved

Create Share on Linux for windows

Posted on 2011-10-10
17
Medium Priority
?
428 Views
Last Modified: 2012-05-12
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?
0
Comment
Question by:bizdata
17 Comments
 
LVL 18

Expert Comment

by:liddler
ID: 36942295
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
 
LVL 41

Expert Comment

by:noci
ID: 36971767
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
 
LVL 9

Expert Comment

by:vaderj
ID: 37011619
If you are still having issues with perms, post your smb.conf - there can be user perms setting in there also
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

Author Comment

by:bizdata
ID: 37056605
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
 
LVL 41

Expert Comment

by:noci
ID: 37056778
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
 

Author Comment

by:bizdata
ID: 37057058
SELinux = Enforcing. I'm still reviewing the log but can't get any clue as to what the problem might be
0
 
LVL 41

Expert Comment

by:noci
ID: 37057525
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
 

Author Comment

by:bizdata
ID: 37062164
This is what I have in the smaba log:
 Samba-Log.txt


Thanks
0
 
LVL 41

Expert Comment

by:noci
ID: 37062894
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
 

Author Comment

by:bizdata
ID: 37063284
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
 
LVL 41

Expert Comment

by:noci
ID: 37063323
chon should have been chcon (change context).

0
 

Author Comment

by:bizdata
ID: 37063744
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
 
LVL 41

Accepted Solution

by:
noci earned 1000 total points
ID: 37064397
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
 
LVL 41

Expert Comment

by:noci
ID: 37064566
You can decide to disable samba selinux with:

 setsebool -P smbd_disable_trans 1

and restart the samba server.
0
 
LVL 41

Expert Comment

by:noci
ID: 37064589
Selinux will continue to be used, except for samba.
0
 

Author Closing Comment

by:bizdata
ID: 37069768
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
 
LVL 41

Expert Comment

by:noci
ID: 37069914
Now you will see the exact failure in /var/log/audit....
look for type AVC records, with avc:  denied
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Loops Section Overview
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question