Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 04-25-2010, 07:24 PM   #1
Registered: Jan 2010
Posts: 30

Rep: Reputation: 16
Unable to view the files shared through samba server


I need help with samba server, I have setup a samba server and I am able to connect to it from the client machine.

But whenever I try to list the files, it doesn't display anything.

here is an excerpt from my smb.conf file:

comment=This folder contains shared files.
valid users=naman yyang
read only=yes
create mask=0755
I have created a folder named testshare in /tmp directory and it has 3 (test1, test2 and test3) files with the permission of 755, yet I am not able to view them.

This is what I get when I try to view the files of the samba-share:

[root@station100 ~]# smbclient -U naman //station51/samba-share
Domain=[STATION51] OS=[Unix] Server=[Samba 3.0.28-0.el5.8]
smb: \> ls
  .                                   D        0  Mon Apr 26 04:42:50 2010
  ..                                  D        0  Mon Apr 26 04:59:56 2010

                38752 blocks of size 262144. 27467 blocks available
smb: \>
The same thing happens when I try to access the share from windows. It let me in to the shared folder, but no files are displayed.

I have cleared all the firewall rules.

Please assist, thanks

Last edited by naman.jandial; 04-25-2010 at 07:33 PM.
Old 04-25-2010, 07:43 PM   #2
Senior Member
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 249Reputation: 249Reputation: 249
I thought you said the share was called testshare ?

What happens when you run
 smbclient -L \\\\station51 -U station51\\naman
Old 04-25-2010, 07:55 PM   #3
Registered: Apr 2007
Distribution: centos,rhel, solaris
Posts: 206

Rep: Reputation: 30
I believe this is a SELINUX problem. I have simulated this on a rhel5 and encountered the similar problem before allowing the folder to be shared through SELINUX.

1. whenever you have problems accessing shares on a linux system: right after an access failure tail your /var/log/messages and you will probably see this:

"Apr 26 08:49:30 server1 setroubleshoot: SELinux is preventing samba (smbd) "getattr" to /tmp/testshare/files1 (tmp_t). For complete SELinux messages. run sealert -l cd89d165-30e7-40e9-a0ac-0a678b2ea261"

2. basically do what it says and run "sealert -l cd89d165-30e7-40e9-a0ac-0a678b2ea261"

3. it will show you why SELINUX blocked the access attempt on the folder. And will even recommend a fix: "chcon -R -t samba_share_t '/tmp/testshare/files1'" ... now just use that command and change the SELINIX settings to share the whole folder and not just the single file.

4. I can now see and access the files.
Old 04-25-2010, 07:58 PM   #4
Registered: Apr 2007
Distribution: centos,rhel, solaris
Posts: 206

Rep: Reputation: 30
Originally Posted by smoker View Post
I thought you said the share was called testshare ?

What happens when you run
 smbclient -L \\\\station51 -U station51\\naman
the path to the folder is testshare but the alias is what is entered between the square brackets: [samba-share]

so we use \\server\<samba-share> to access the samba shared folder.
Old 04-26-2010, 07:07 AM   #5
Registered: Jan 2010
Posts: 30

Original Poster
Rep: Reputation: 16
Thanks guys for your quick replies.

The following command
chcon -R -t samba_share_t /tmp/testshare/
worked just fine. I am now able to vie al;l the files shared there.

You guys are awesome. Thanks again.


naman, samba

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
Samba - Unable to view other computers Nicolice Linux - Networking 4 10-19-2008 05:50 AM
unable to view files by files when ls in text mode jenson Linux - Server 2 06-20-2008 07:57 AM
unable to view .vsd files (Visio Files) mr_manny Linux - General 5 11-30-2006 07:03 PM
Samba 2.2.8 - Unable to access shared resources takatam Linux - Networking 2 08-10-2004 05:22 AM
Unable to view cd files erycz Linux - General 1 11-04-2003 08:24 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:57 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration