LinuxQuestions.org
Visit the LQ Articles and Editorials section
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
 
Search this Thread
Old 04-25-2010, 08:24 PM   #1
naman.jandial
Member
 
Registered: Jan 2010
Posts: 30

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


Hi

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:

Code:
[samba-share]
comment=This folder contains shared files.
path=/tmp/testshare/
valid users=naman yyang
public=no
writable=no
read only=yes
create mask=0755
browsable=yes
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:

Code:
[root@station100 ~]# smbclient -U naman //station51/samba-share
Password: 
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 08:33 PM.
 
Old 04-25-2010, 08:43 PM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

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

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

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.

steps:
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, 08:58 PM   #4
chickenjoy
Member
 
Registered: Apr 2007
Distribution: centos,rhel, solaris
Posts: 200

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

What happens when you run
Code:
 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, 08:07 AM   #5
naman.jandial
Member
 
Registered: Jan 2010
Posts: 30

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

The following command
Code:
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.
 
  


Reply

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


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

Main Menu
Advertisement
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