LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Samba error when trying to connect to shares (https://www.linuxquestions.org/questions/linux-software-2/samba-error-when-trying-to-connect-to-shares-521649/)

remyforbes777 01-22-2007 06:22 AM

Samba error when trying to connect to shares
 
Hey guys I am getting the error
lib/util_sock.c:read_socket_with_timeout whenever I try to connect to my samba shares. Any ideas on the problem.
I am using SMB4K to connect to my samba shares.


Code:

#======================= Global Settings =======================

[global]

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = TRITECHSOL
# netbios name = SAMBASERVER
# server string is the equivalent of the NT Description field
server string = %h server (Samba, Ubuntu)




# This will prevent nmbd to search for NetBIOS names through DNS.
dns proxy = no





####### Authentication #######

# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/ServerType.html in the samba-doc
# package for details.
security = user

# You may wish to use password encryption. See the section on
# 'encrypt passwords' in the smb.conf(5) manpage before enabling.
encrypt passwords = false
# If you are using encrypted passwords, Samba will need to know what
# password database type you are using.
# passdb backend = tdbsam guest

# obey pam restrictions = yes

; guest account = nobody
invalid users = root

# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
; unix password sync = no

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Augustin Luton <aluton@hybrigenics.fr> for
# sending the correct chat script for the passwd program in Debian Potato).
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n .

# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
; pam password change = no



# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
; include = /home/samba/etc/smb.conf.%m

# Most people will find that this option gives better performance.
# See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/speed.html
# for details
# You may want to add the following on a Linux system:
# SO_RCVBUF=8192 SO_SNDBUF=8192
socket options = TCP_NODELAY





# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
; idmap uid = 10000-20000
; idmap gid = 10000-20000
; template shell = /bin/bash

#======================= Share Definitions =======================

[homes]
comment = Home Directories
browseable = no

# By default, the home directories are exported read-only. Change next
# parameter to 'yes' if you want to be able to write to them.
writable = no

# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
create mask = 0700

# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
directory mask = 0700

# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
; comment = Network Logon Service
; path = /home/samba/netlogon
; guest ok = yes
; writable = no
; share modes = no

[
[music]
path = /mnt/mediashare1
browsable = yes
writeable = yes
valid users = remyforbes777
admin users = remyforbes777
read only = no

[backup]
path = /mnt/mediashare2
browsable = yes
writeable = yes
public = no


output of mount command on samba server

Code:

/dev/hda1 on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
usbfs on /proc/bus/usb type usbfs (rw)
tmpfs on /lib/modules/2.6.12-10-386/volatile type tmpfs (rw,mode=0755)
/dev/hda5 on /home type ext3 (rw)
/dev/hda6 on /usr type ext3 (rw)
/dev/hda7 on /var type ext3 (rw)
tmpfs on /dev type tmpfs (rw,size=10M,mode=0755)
/dev/hdc on /mnt/mediashare1 type ext3 (rw)

Share permissions

Code:

total 20
drwxrwxrwx  9 root root 16384 2007-01-21 20:12 mediashare1
drwxrwxrwx  2 root root  4096 2007-01-15 22:41 mediashare2

command used to add user remyforbes777
Code:

sudo smbpasswd -a remyforbes777
testparm output

Code:

testparm /etc/samba/smb.conf
Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[printers]"
Processing section "[print$]"
Processing section "[music]"
Processing section "[backup]"
Global parameter smb ports found in service section!
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

# Global parameters
[global]
        workgroup = TRITECHSOL
        server string = %h server (Samba, Ubuntu)
        encrypt passwords = No
        passwd program = /usr/bin/passwd %u
        passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n .
        syslog = 0
        log file = /var/log/samba/log.%m
        max log size = 1000
        dns proxy = No
        panic action = /usr/share/samba/panic-action %d
        invalid users = root

[homes]
        comment = Home Directories
        create mask = 0700
        directory mask = 0700
        browseable = No

[printers]
        comment = All Printers
        path = /tmp
        create mask = 0700
        printable = Yes
        browseable = No

[print$]
        comment = Printer Drivers
        path = /var/lib/samba/printers

[music]
        path = /mnt/mediashare1
        valid users = remyforbes777
        admin users = remyforbes777
        read only = No

[backup]
        path = /mnt/mediashare2
        read only = No


remyforbes777 01-25-2007 12:21 PM

Link to PCAP file for samba session http://www.cinci2600.com/?fuseaction=download.go&id=21http://www.cinci2600.com/?fuseaction=download.go&id=20[/URL]

int0x80 01-26-2007 12:36 PM

Recommendations:

1. Trim down your smb.conf dump to just the relevant material, and enclose it in the CODE tags.
2. Post the results of running the command testparm, and enclose it in the CODE tags.
3. Remove the excessive ASCII dump from your sniffer. Instead upload and link the pcap file.
4. Specify the filter options that were used in your sniffing.
5. Show the output of mount on the samba server, and enclose it in the CODE tags.
6. Post the permissions of the shares on the filesystem on the samba server, and enclose them in the CODE tags.
7. Show the command you used to add the user remyforbes777 to your samba access list, and enclose it in the CODE tags.
8. Post any INPUT filter rules on your samba server, and any OUTPUT filter rules on your client, and enclose them in the CODE tags.

int0x80 01-26-2007 11:38 PM

No testparm output from you, but here is what I got:
Code:

int0x80:~$ testparm /tmp/smb.conf
Load smb config files from /tmp/smb.conf
Processing section "[homes]"
params.c:Section() - Badly formed line in configuration file:
params.c:pm_process() - Failed.  Error returned from params.c:parse().
Error loading services.

From your mount output on the samba server, mediashare2 is not mounted. Could this be part of the problem?

If you only issued the command smbpasswd then your user was not added, that could be part of the problem. If you included any flags/parameters, please specify them along with the command. Include any relevant output.

Also, probably inconsequential to your problem, you should not have your share owned by root with permissions 777. If everyone can read, write, and execute, then make the contents owned by a non-privileged user. That is just speaking from a system administration and security perspective on ownership and permissions.

Checked the pcap file, few issues:

1. Where are your filters? You didn't specify any in your thread and there is traffic from or to two other public IP addresses in your dump.

2. You don't have a complete session in your dump. You start with the client and server terminating a session (your FIN/ACKs), and then show a new session starting; but we never see what happens in the new session.

Make sure you start sniffing before you begin your samba session, then stop sniffing after the samba session is over. Please also use filters.

You didn't respond with any firewall rules? Were there any?

My guess right now is a problem with the setup of samba itself, and not a network issue. Then again, I don't have all the pieces yet :)

remyforbes777 01-27-2007 09:12 AM

I am aware of the permissions issue. It was a temporary thing. What is funny is the /mnt/mediashare2 does not show as being mounted but it is. I can navigate to it and also when samba was working right I could connect to it.

There is not any filters because I didn't use any. I will do another one and include filters.

No firewall rules at all.
sudo smbpasswd -a remyforbes777 is the specific exact command I used.

New pcap file had been downloaded.

int0x80 01-27-2007 10:26 AM

Based on your pcap file (PS: your link doesn't work), I don't think it is a network issue at all. While you are not conducting a full samba session, the machines can still see and talk to each other just fine. This leads me to believe the error lies with the samba setup. Have you at least fixed your smb.conf such that testparm checks out alright? Also what resources/sites did you use/read in setting everything up? Honestly samba is very simple to set up, and it could just be that the sites you used were inaccurate or out-dated.

remyforbes777 01-27-2007 03:24 PM

The link is now fixed. I forgot to change the link when i uploaded the new pcap file. The thing is, I have not changed anything with my smb.conf file and it has been working correctly for almost a year, then out of the blue it stopped working.

int0x80 01-28-2007 10:13 AM

What other changes have happened on the samba server? Did any binaries change (eg: dist-upgrade)? Do you have an md5 of your smb.conf before these problems occurred? Is it the same as the md5 of the current smb.conf?

Have you tried just mounting the shares with smbmount or mount -t smbfs?

These are items from previous posts that I requested but still haven't seen:

Quote:

1. Trim down your smb.conf dump to just the relevant material, and enclose it in the CODE tags.
2. Post the results of running the command testparm, and enclose it in the CODE tags.
3. Have you at least fixed your smb.conf such that testparm checks out alright?
4. Also what resources/sites did you use/read in setting everything up?
Seriously samba took me at most 30 seconds to set up and test. Perhaps you should scrap your current samba setup and reinstall to have a clean slate. There really isn't much to it. Kinda like rebooting a Windows computer whenever it starts getting fussy -- usually fixes the problem :)

remyforbes777 01-28-2007 12:03 PM

Quote:

Originally Posted by int0x80
What other changes have happened on the samba server? Did any binaries change (eg: dist-upgrade)? Do you have an md5 of your smb.conf before these problems occurred? Is it the same as the md5 of the current smb.conf?

Have you tried just mounting the shares with smbmount or mount -t smbfs?

These are items from previous posts that I requested but still haven't seen:



Seriously samba took me at most 30 seconds to set up and test. Perhaps you should scrap your current samba setup and reinstall to have a clean slate. There really isn't much to it. Kinda like rebooting a Windows computer whenever it starts getting fussy -- usually fixes the problem :)

The output of testparm and the smb.conf file is and has been included in my above post. I know how to set up samba and it has been set up and working perfectly for a while , it just all of sudden went haywire. I don't have the exact docs that I used to set it up because it has been a while since I set it up.

int0x80 01-28-2007 03:43 PM

Oh I see, you edited your original post yesterday... Thanks for pointing that out :rolleyes:

Here are some of the results from my setup:

2. Post the results of running the command testparm, and enclose it in the CODE tags.
Code:

[global]
        workgroup = HOMENET
        server string = %h server (Samba %v)
        obey pam restrictions = Yes
        passdb backend = tdbsam
        passwd program = /usr/bin/passwd %u
        passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n .
        syslog = 0
        log file = /var/log/samba/log.%m
        max log size = 1000
        dns proxy = No
        panic action = /usr/share/samba/panic-action %d
        invalid users = root

[files]
        comment = Shared Files
        path = /files
        valid users = int0x80
        read only = No

[share]
        comment = Shared Files
        path = /share
        valid users = int0x80
        read only = No

5. Show the output of mount on the samba server, and enclose it in the CODE tags.
Code:

/dev/md2 on /files type ext3 (rw)
/dev/md3 on /share type ext3 (rw)

6. Post the permissions of the shares on the filesystem on the samba server, and enclose them in the CODE tags.
Code:

$ tree -d -L 2 /share/
/share/
|-- int0x80
|  |-- backup
|  |-- documents
|  |-- media
|  |-- work
...
$ ls -l /share
drwx--x--x 9 int0x80 int0x80  4096 2007-01-14 15:58 int0x80

HTH

remyforbes777 01-28-2007 04:49 PM

Okay, I totally forgot about the tree command. I will re edit my initial post and include that information.


All times are GMT -5. The time now is 12:48 PM.