LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   I can see my Samba share but cannot access it. (https://www.linuxquestions.org/questions/linux-server-73/i-can-see-my-samba-share-but-cannot-access-it-721386/)

newnewbie 04-24-2009 07:21 AM

I can see my Samba share but cannot access it.
 
Good morning to all!

This is my first post. I am not all that new to Linux. I have done lots of reading on the OS but always felt a little timid when it came to trying out stuff.

Here is my problem I have a stand alone samba server I am trying to setup to share all my digital photos and other doc. I can see the share from other machines. On the windows machines you can see the users home directory and the share itself in an folder icon. Whenever I try to access the share it asks for a passwd. I enter the passwd and the share folder is visible when I click on the folder I get and error message.

The share name is pics so I get the error.


pics is not accessible. You might not have permissions to use this network resource. contact the network administrator of this server to find out if you have access permissions.

no network provider accepted the given network path.



On my other Linux boxes. I can see the share when I click on it, there is just a empty folder without any files.



Here is my samba config file.


workgroup = cleus
server string = Samba Server
security = user
encrypt passwords = yes
; guest ok = no
; guest account = nobody
; encrypt passwords = yes
; guest ok = no
; guest account = nobody
[homes]
comment = Home Directories
browseable = yes
writeable = yes
; valid users = %S
; valid users = MYDOMAIN\%S

[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
; guest ok = no
; writeable = no
printable = yes
# Un-comment the following and create the netlogon directory for Domain Logons
; [netlogon]
; comment = Network Logon Service
; path = /var/lib/samba/netlogon
; guest ok = yes
; writable = no
; share modes = no


# Un-comment the following to provide a specific roving profile share
# the default is to use the user's home directory
; [Profiles]
; path = /var/lib/samba/profiles
; browseable = no
; guest ok = yes


# A publicly accessible directory, but read only, except for people in
# the "staff" group
; [public]
; comment = Public Stuff
; path = /home/samba
; public = yes
; writable = yes
; printable = no
; write list = +staff

[pics]
comment = all our photos
path = /pics
; writeable = no
; browseable = yes
guest ok = yes






These are the permissions I have on the shared files.


drwxr-xr-x 2 root root 12288 Mar 30 16:10 Pictures
-r-xr-xr-x 1 root root 658215 Oct 14 2005 Pictures 001.jpg
-r-xr-xr-x 1 root root 305772 Oct 14 2005 Pictures 002.jpg




Thanks for all the help.

TBC Cosmo 04-24-2009 07:29 AM

Have you added the appropriate users permitted to access the shares via 'smbpasswd -a'?

newnewbie 04-24-2009 07:49 AM

I didn't forget
 
yes I did for all the users on my server.

smbpasswd -a username for all the users

mail2mphani 04-24-2009 08:08 AM

r u enable the hosts allow

jschiwal 04-24-2009 08:39 AM

What are the permissions on the /pics directory. For guest access, it should be r-x rights for other.

newnewbie 04-24-2009 09:28 AM

This is the permission on the folder



[root@fileserver pics]# ls -al
total 8512
drwxrwxrwx 4 root root 4096 Sep 25 2008 .
drwxr-xr-x 24 root root 4096 Apr 6 23:36 ..




How can I configure host allow?

chitambira 04-24-2009 10:18 AM

Samba, on its own, assumes the samba users you created exist in the system.
If you need the samba passwd and the system passwd to be the same, you should add to smb.conf(G):
Quote:

unix password sync = yes
If however you dont want users to be asked for a password when they connect to a share (as u indicated by enabling guest ok)
then you need to modify security level to share in smb.conf(G):
Quote:

security = share
and on the share defination
Quote:

[pics]
comment = all our photos
path = /pics
read only = yes
browseable = yes
guest ok = yes

newnewbie 04-24-2009 12:11 PM

I tried
 
I tried what you said and get the same results. The only difference is that I can browse homes.

jschiwal 04-24-2009 05:55 PM

I don't agree with modifying the line to "Security = Share". That technology is for Windows 95 and obsolete. The Samba 3 HOWTO & Reference guide only has a short paragraph describing it.

Code:

[root@fileserver pics]# ls -al
total 8512
drwxrwxrwx 4 root root 4096 Sep 25 2008 .
drwxr-xr-x 24 root root 4096 Apr 6 23:36 ..

You should use "ls -ld /pics" but I think the result is the same as the ".." entry.
You also need in the general section of smb.conf the line:
Code:

map to guest = bad user
This will map an unauthorized user to the user "guest" in Windows and the user "nobody" in Linux. The "nobody" user has read rights to the share as it is presently defined.

These two changes should be enough.

---

Also make sure that you have the services starting up when you boot. And check your firewall settings. I would run nmap locally, and then from a different host. Compare the list of open ports and see if any samba port is blocked. Check the TCP & UDP ports. To save time check 119, 135-139 & 445.

From the Samba 3.2 HOWTO:
Code:

If you are setting up a rewall, you need to know what TCP and UDP ports
to allow and block. Samba uses the following:
Port 135/TCP - used by smbd
Port 137/UDP - used by nmbd
Port 138/UDP - used by nmbd
Port 139/TCP - used by smbd
Port 445/TCP - used by smbd

I might be remembering wrong, because I thought they were 136-139 & 445. You'll want to double check that. Not all may be used with XP but it depends you how XP is configured. Browsing from some Linux clients may work better if you open the udp ports as well.

billymayday 04-24-2009 05:58 PM

What distro are you running? Could be an SELinux issue

newnewbie 04-24-2009 10:16 PM

I think this is the problem when I ran testparm I get this error message.


ERROR: the 'passwd program' () requires a '%u' parameter

newnewbie 04-24-2009 10:26 PM

I am using CentOS 5.2

newnewbie 04-24-2009 10:30 PM

These are the errors I need to focus on. Any ideas?


ERROR: the 'unix password sync' parameter is set and the 'passwd program' () cannot be executed (error was No such file or directory).
ERROR: the 'passwd program' () requires a '%u' parameter.

billymayday 04-24-2009 10:45 PM

According to the config you posted, you don't have that set anyway, but comment the relevant line out in smb.conf

jschiwal 04-25-2009 07:19 AM

How many users do you have? How do they authenticate? Do you want to run the samba server as a domain controller? For a globally readable share, authentication isn't necessary. You can comment out the unix password sync line as billymayday suggested.


All times are GMT -5. The time now is 03:31 PM.