Cannot connect to samba share
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2009
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cannot connect to samba share

    Trying to setup Samba for the first time and am unable to connect to the share from my Windows machine. It is a very basic setup, just trying to setup a single share to use a backup location for my windows files.

    I've done the following:
    1. Fresh install if fedora 15
    2. installed samba
    rpm -qa | grep samba
    gives the following:
    Code:
    samba-common-3.5.8-68.fc15.1.i686
    samba-swat-3.5.8-68.fc15.1.i686
    system-config-samba-docs-1.0.9-2.fc15.noarch
    samba-winbind-clients-3.5.8-68.fc15.1.i686
    samba-3.5.8-68.fc15.1.i686
    samba-client-3.5.8-68.fc15.1.i686
    system-config-samba-1.2.91-2.fc15.noarch
    3. Used samba server configuration to setup the share and create the samba users
    4. When I tried to connect from my windows machine I get the error that the server is not accessible, you might not have permission to use this network resource or I get the error "windows cannot access server, check spelling and try again.

    Both computers can ping each other.

    I opened samba ports in the linux firewall and tried to connect again: same error
    Disabled firewall all together and have the same error.

    Here is the output from the testparm command
    Code:
    Load smb config files from /etc/samba/smb.conf
    rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
    Processing section "[homes]"
    Processing section "[printers]"
    Processing section "[backups]"
    Loaded services file OK.
    Server role: ROLE_STANDALONE
    Press enter to see a dump of your service definitions
    
    [global]
    	server string = Samba Server Version %v
    	log file = /var/log/samba/log.%m
    	max log size = 50
    	cups options = raw
    
    [homes]
    	comment = Home Directories
    	read only = No
    	browseable = No
    
    [printers]
    	comment = All Printers
    	path = /var/spool/samba
    	printable = Yes
    	browseable = No
    
    [backups]
    	path = /home/backups
    	read only = No
    	guest ok = Yes

    smb and nmb services are running:
    service smb status
    Code:
    smb.service - SYSV: Starts and stops the Samba smbd daemon used to provide SMB network services.
    	  Loaded: loaded (/etc/rc.d/init.d/smb)
    	  Active: active (running) since Tue, 14 Jun 2011 13:36:26 -0600; 1h 39min ago
    	 Process: 1060 ExecStart=/etc/rc.d/init.d/smb start (code=exited, status=0/SUCCESS)
    	Main PID: 1072 (smbd)
    	  CGroup: name=systemd:/system/smb.service
    		  ├ 1072 smbd -D
    		  └ 1081 smbd -D
    service nmb status
    Code:
    nmb.service - SYSV: Starts and stops the Samba smbd and nmbd daemons used to provide SMB network services.
    	  Loaded: loaded (/etc/rc.d/init.d/nmb)
    	  Active: active (running) since Tue, 14 Jun 2011 14:12:25 -0600; 1h 5min ago
    	 Process: 1905 ExecStart=/etc/rc.d/init.d/nmb start (code=exited, status=0/SUCCESS)
    	Main PID: 1914 (nmbd)
    	  CGroup: name=systemd:/system/nmb.service
    		  └ 1914 nmbd -D

    When I do smbclient -L localhost I get:
    Code:
    Receiving SMB: Server stopped responding
    session setup failed: Call timed out: server did not respond after 20000 milliseconds
    From my searching, the timeout results from services not running. From what I can tell, the necessary samba services are running. Any thoughts?

  2. #2
    Join Date
    Apr 2011
    Posts
    188
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Cannot connect to samba share

    Have you made the necessary adjustments for SELinux?

  3. #3
    Join Date
    Mar 2009
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Cannot connect to samba share

    Quote Originally Posted by jtfolden
    Have you made the necessary adjustments for SELinux?
    I didn't think selinux was blocking anything because it did not give me any alerts. Just to be safe, I turned off selinux and tried to connect to the share again and still received the same error.

  4. #4
    Join Date
    Jul 2005
    Posts
    1,054
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Cannot connect to samba share

    If it helps, this is what I do on my small mixed lan
    In smb.conf make sure the samba server is in the correct workstation/domain
    security = user
    then run smbpasswd -a to add necessary windows user names and passwords.
    verify smb ports are open in firewalls
    start the smb and nmb services on fedora

    This basic process has always worked for me. I have maybe 10 computers half windows half fedora and they all share stuff over samba.
    ======
    Doug G
    ======

  5. #5
    Join Date
    Mar 2009
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Cannot connect to samba share

    So I've isolated the problem to the user id. If I switch to security = share it works just fine. I switch back to user and I can't connect. It doesn't even prompt me for a password.

    Before I found all this out I installed fedora on a VM and set up samba. I could connect to the VM share just fine, it prompted me for a username/password, I entered the one I setup in samba and it connected.

    On my physical fedora box, when I connect, it just denies me without asking for a password.

  6. #6
    Join Date
    Oct 2008
    Location
    Poland
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Cannot connect to samba share

    Hello,

    Are there any useful informations in /var/log/samba/log.%m ?

    First of all check whether smbd and nmbd are ready to work.

    [root@quagga samba]# netstat -alnp | egrep ":137|:138|:139|:445"
    Code:
    tcp        0      0 :::139                      :::*                        LISTEN      2086/smbd           
    tcp        0      0 :::445                      :::*                        LISTEN      2086/smbd           
    udp        0      0 0.0.0.0:137                 0.0.0.0:*                               1907/nmbd           
    udp        0      0 0.0.0.0:138                 0.0.0.0:*                               1907/nmbd           
    [root@quagga samba]#
    Also check whether your users database is correctly created.
    Code:
    pdbedit -wL
    It should show users account which you added.

    If it's ok try add:
    Code:
    security = user
    passdb backend = tdbsam
    to global section smb.conf file.

  7. #7
    Join Date
    Jul 2011
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Cannot connect to samba share

    Had exactly the same problem as Squires. (worked with security = share, not with user)

    Anyway, turned out that it was not a problem with SELinux. I have my firewall on with the samba ports open.

    So turned up the debug log level to 4, and poked around in the logs, and finally found out why it was failing.
    For whatever reason when I have security = user on, the logs kept coming up with

    interpret_string_addr_internal: getaddrinfo failed for name server.frednet [Name or service not known]
    log.__ffff_127.0.0.1: get_mydnsfullname: getaddrinfo failed for name server.frednet [Unknown error]

    not really sure why it wanted to resolve names as I was trying

    smbclient \\\\127.0.0.1\\share

    but whatever, the solution is quite simple, just add the line
    127.0.0.1 server.frednet

    to /etc/hosts and it works like a charm. (of course, substitute the name of YOUR server !)

    It might work with the real IP address of the server as well, have not tried that.

    I also had a brand new share off a LVM system, so I also ran
    chcon -t samba_share_t /path/to/directory
    to make it selinux friendly.

    Also, I was configuring it with the GNOME tools on FC15, and the line in smb.conf with
    passdb backend = tdbsam
    was commented out with a semicolon which probably didn't help either (just uncomment it)

    So I can now access it from a XP home machine with user authentication.

Similar Threads

  1. How to connect to Windows share?
    By PseudoPsyche in forum Servers & Networking
    Replies: 4
    Last Post: 27th March 2011, 07:40 PM
  2. Cannot connect my Win7 and Mac0S 10.6 computers to Samba share
    By urhumblefedora in forum Servers & Networking
    Replies: 5
    Last Post: 3rd January 2010, 11:31 PM
  3. F8 connect to Samba share
    By rlclemens in forum Using Fedora
    Replies: 7
    Last Post: 25th August 2008, 08:39 PM
  4. connect 2003 share to Fedora 7
    By jmfast in forum Servers & Networking
    Replies: 1
    Last Post: 9th October 2007, 02:20 AM
  5. FC6 wont connect to a Windows Share
    By GMScribe in forum Servers & Networking
    Replies: 1
    Last Post: 10th April 2007, 01:23 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •