I can connect to Samba server but cannot access shares.

Posted by jlego on Server Fault See other posts from Server Fault or by jlego
Published on 2012-06-04T19:21:27Z Indexed on 2014/06/02 21:31 UTC
Read the original article Hit count: 195

I'm having trouble getting samba sharing working to access shares.

I have setup a stand-alone box running Fedora 16 to use as a file-sharing and web development server. It needs to be able to share files with a Windows 7 PC and a Mac running OSX Snow Leopard.

I've setup Samba using the Samba configuration GUI tool on Fedora. Added users to Fedora and connected them as Samba users (which are the same as the Windows and Mac usernames and passwords). The workgroup name is the same as the Windows workgroup. Authentication is set to User. I've allowed Samba and Samba client through the firewall and set the ethernet to a trusted port in the firewall.

Both the Windows and Mac machines can connect to the server and view the shares, however when trying to access the shares, Windows throws error:

0x80070035 " Windows cannot access \\SERVERNAME\ShareName." 

Windows user is not prompted for a username or password when accessing the server (found under "Network Places"). This also happens when connecting with the IP rather than the server name.

The Mac can also connect to the server and see the shares but when choosing a share gives the error:

The original item for ShareName cannot be found.

When connecting via IP, the Mac user is prompted for username and password, which when authenticated gives a list of shares, however when choosing a share to connect to, the error is displayed and the user cannot access the share.

Since both machines are acting similarly when trying to access the shares, I assume it is an issue with how Samba is configured.

smb.conf:

[global]

    workgroup = workgroup
    server string = Server
    log file = /var/log/samba/log.%m
    max log size = 50
    security = user
    load printers = yes
    cups options = raw
    printcap name = lpstat
    printing = cups


[homes]
    comment = Home Directories
    browseable = no
    writable = yes


[printers]
    comment = All Printers
    path = /var/spool/samba
    browseable = yes
    printable = yes

[FileServ]
    comment = FileShare
    path = /media/FileServ
    read only = no
    browseable = yes
    valid users = user1, user2

[webdev]
    comment = Web development
    path = /var/www/html/webdev
    read only = no
    browseable = yes
    valid users = user1

How do I get samba sharing working?

UPDATE: I Figured it out, it was because I was sharing a second hard drive. See checked answer below.

Speculation 1: Before this box I had another box with the same version of fedora installed (16) and samba working for these same computers. I started up the old machine and copied the smb.conf file from the old machine to the new one (editing the share definitions for the new shares of course) and I still get the same errors on both client machines. The only difference in environment is the hardware and the router. On the old machine the router received a dynamic public IP and assigned dynamic private IPs to each device on the network while the new machine is connected to a router that has a static public IP (still dynamic internal IPs though.) Could either one of these be affecting Samba?

Speculation 2: As the directory I am trying to share is actually an entire internal disk, I have tried these things:

1.) changing the owner of the mounted disk from root to my user (which is the same username as on the Windows machine)

2.) made a share that only included one of the folders on the disk instead of the entire disk with my user again as the owner.

Both tests failed giving me the same errors regarding the network address.

Speculation 3: Whenever I try to connect to the share on the Windows 7 client I am prompted for my username and password. When I enter the correct credentials I get an access denied message. However I did notice that under the login box "domain: WINDOWS-PC-NAME" is listed. I believe this could very well be the problem.

Speculation 4: So I've completely reinstalled Fedora and Samba now. I've created a share on the first harddrive (one fedora is installed on) and I can access that fine from Windows. However when I try to share any data on the second disk, I am receiving the same error. This I believe is the problem. I think I need to change some things in fstab or fdisk or something.

Speculation 5: So in fstab I mapped the drive to automount in a folder which works correctly. I also added the samba_share_t SElinux label to the mountpoint directory which now allows me to access the shares on the Windows machine, however I cannot see any of the files in the directory on the windows machine. (They are there, I can see them in the fedora file browser locally)

© Server Fault or respective owner

Related posts about linux

Related posts about samba

  • Unable to connect to Samba printer

    as seen on Ask Ubuntu - Search for 'Ask Ubuntu'
    I have a headless Ubuntu 12.04 server for files and printers. It shares files via Samba just fine. However, the HP PSC-750xi connected to the server via USB is not accessible from my Ubuntu 12.04 laptop. I can browse for it in the Printing control panel, but any attempt to authenticate my ID to the… >>> More

  • Samba folder is gone

    as seen on Ask Ubuntu - Search for 'Ask Ubuntu'
    I seem to have some issues sharing folders from my Ubuntu 12.04 machine to a Win7 machine. After playing around with the settings, I decided to revert to Samba's original setting by reinstalling it: sudo apt-get purge samba sudo rm -rf /etc/samba/ /etc/default/samba sudo apt-get install samba just… >>> More

  • Samba on OS X 10.6.4

    as seen on Server Fault - Search for 'Server Fault'
    I just updated from 10.6.3 to 10.6.4, and now my Samba shares won't mount and won't allow access into the directories. In the logs, I've started to get the following errors, any idea what might have gone wrong? 2010/06/25 15:54:27, 0, pid=13848] /SourceCache/samba/samba-235.4/samba/source/passdb/secrets… >>> More

  • OpenLDAP and Samba, can't log onto Samba share from Windows

    as seen on Server Fault - Search for 'Server Fault'
    The former jackass IT-guy that I'm taking over for had a Samba share setup on a Fedora server that uses our OpenLDAP server to authenticate users who want to log in from Windows. We recently added a new employee and I jumped through the LDAP hoops to add them to the system. However, I can't seem… >>> More

  • Windows 7 Samba issue

    as seen on Server Fault - Search for 'Server Fault'
    We have a strange samba issue affecting only one user. Our samba setup is as follow : Red Hat Enterprise Linux Server release 5.4 (Tikanga) - Samba Server Samba version 3.0.33-3.14.el5 - Samba version Domain Controller WIN2008R2 Standard -… >>> More