LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 11-17-2009, 05:49 PM   #1
johnh10000
Member
 
Registered: Nov 2008
Distribution: Ubuntu Lucid Lynx
Posts: 541

Rep: Reputation: 33
daft samba problem


Not sure what happened, it has been working just fine. To explain, I have two ubuntu jaunty boxes sat next to one another, and my girlfriends lappy usully via wifi and and win xp box.

So when hell happened I copied the smb.conf frum tux2 to tux, restarted, and checked. Nope, cant find any shares. Out curiosty I logged onto tux2 and asked agine. Now it can find tux, and all is fine, so can lappy.

So it's sorta working, but not from tux.

what is going on ????
Code:
#

# Sample configuration file for the Samba suite for Debian GNU/Linux.

#

#

# This is the main Samba configuration file. You should read the

# smb.conf(5) manual page in order to understand the options listed

# here. Samba has a huge number of configurable options most of which 

# are not shown in this example

#

# Some options that are often worth tuning have been included as

# commented-out examples in this file.

#  - When such options are commented with ";", the proposed setting

#    differs from the default Samba behaviour

#  - When commented with "#", the proposed setting is the default

#    behaviour of Samba but the option is considered important

#    enough to be mentioned here

#

# NOTE: Whenever you modify this file you should run the command

# "testparm" to check that you have not made any basic syntactic 

# errors. 

# A well-established practice is to name the original file

# "smb.conf.master" and create the "real" config file with

# testparm -s smb.conf.master >smb.conf

# This minimizes the size of the really used smb.conf file

# which, according to the Samba Team, impacts performance

# However, use this with caution if your smb.conf file contains nested

# "include" statements. See Debian bug #483187 for a case

# where using a master file is not a good idea.

#



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



[global]



## Browsing/Identification ###



# Change this to the workgroup/NT-domain name your Samba server will part of

   workgroup = WORKGROUP



# server string is the equivalent of the NT Description field

   server string = %h server (Samba, Ubuntu)



# Windows Internet Name Serving Support Section:

# WINS Support - Tells the NMBD component of Samba to enable its WINS Server

#   wins support = no



# WINS Server - Tells the NMBD components of Samba to be a WINS Client

# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both

;   wins server = w.x.y.z



# This will prevent nmbd to search for NetBIOS names through DNS.

   dns proxy = no



# What naming service and in what order should we use to resolve host names

# to IP addresses

;   name resolve order = lmhosts host wins bcast



#### Networking ####



# The specific set of interfaces / networks to bind to

# This can be either the interface name or an IP address/netmask;

# interface names are normally preferred

;   interfaces = 127.0.0.0/8 eth0



# Only bind to the named interfaces and/or networks; you must use the

# 'interfaces' option above to use this.

# It is recommended that you enable this feature if your Samba machine is

# not protected by a firewall or is a firewall itself.  However, this

# option cannot handle dynamic or non-broadcast interfaces correctly.

;   bind interfaces only = yes







#### Debugging/Accounting ####



# This tells Samba to use a separate log file for each machine

# that connects

   log file = /var/log/samba/log.%m



# Cap the size of the individual log files (in KiB).

   max log size = 1000



# If you want Samba to only log through syslog then set the following

# parameter to 'yes'.

#   syslog only = no



# We want Samba to log a minimum amount of information to syslog. Everything

# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log

# through syslog you should set the following parameter to something higher.

   syslog = 0



# Do something sensible when Samba crashes: mail the admin a backtrace

   panic action = /usr/share/samba/panic-action %d





####### 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/Samba3-HOWTO/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 = true



# If you are using encrypted passwords, Samba will need to know what

# password database type you are using.  

   passdb backend = tdbsam



   obey pam restrictions = yes



# 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 = yes



# For Unix password sync to work on a Debian GNU/Linux system, the following

# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for

# sending the correct chat script for the passwd program in Debian Sarge).

   passwd program = /usr/bin/passwd %u

   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .



# 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 = yes



# This option controls how unsuccessful authentication attempts are mapped 

# to anonymous connections

   map to guest = bad user



########## Domains ###########



# Is this machine able to authenticate users. Both PDC and BDC

# must have this setting enabled. If you are the BDC you must

# change the 'domain master' setting to no

#

;   domain logons = yes

#

# The following setting only takes effect if 'domain logons' is set

# It specifies the location of the user's profile directory

# from the client point of view)

# The following required a [profiles] share to be setup on the

# samba server (see below)

;   logon path = \\%N\profiles\%U

# Another common choice is storing the profile in the user's home directory

# (this is Samba's default)

#   logon path = \\%N\%U\profile



# The following setting only takes effect if 'domain logons' is set

# It specifies the location of a user's home directory (from the client

# point of view)

;   logon drive = H:

#   logon home = \\%N\%U



# The following setting only takes effect if 'domain logons' is set

# It specifies the script to run during logon. The script must be stored

# in the [netlogon] share

# NOTE: Must be store in 'DOS' file format convention

;   logon script = logon.cmd



# This allows Unix users to be created on the domain controller via the SAMR

# RPC pipe.  The example command creates a user account with a disabled Unix

# password; please adapt to your needs

; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u



# This allows machine accounts to be created on the domain controller via the 

# SAMR RPC pipe.  

# The following assumes a "machines" group exists on the system

; add machine script  = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u



# This allows Unix groups to be created on the domain controller via the SAMR

# RPC pipe.  

; add group script = /usr/sbin/addgroup --force-badname %g



########## Printing ##########



# If you want to automatically load your printer list rather

# than setting them up individually then you'll need this

#   load printers = yes



# lpr(ng) printing. You may wish to override the location of the

# printcap file

;   printing = bsd

;   printcap name = /etc/printcap



# CUPS printing.  See also the cupsaddsmb(8) manpage in the

# cupsys-client package.

;   printing = cups

;   printcap name = cups



############ Misc ############



# 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/Samba3-HOWTO/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



# The following parameter is useful only if you have the linpopup package

# installed. The samba maintainer and the linpopup maintainer are

# working to ease installation and configuration of linpopup and samba.

;   message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &



# Domain Master specifies Samba to be the Domain Master Browser. If this

# machine will be configured as a BDC (a secondary logon server), you

# must set this to 'no'; otherwise, the default behavior is recommended.

#   domain master = auto



# 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



# The following was the default behaviour in sarge,

# but samba upstream reverted the default because it might induce

# performance issues in large organizations.

# See Debian bug #368251 for some of the consequences of *not*

# having this setting and smb.conf(5) for details.

;   winbind enum groups = yes

;   winbind enum users = yes



# Setup usershare options to enable non-root users to share folders

# with the net usershare command.



# Maximum number of usershare. 0 (default) means that usershare is disabled.

;   usershare max shares = 100



# Allow users who've been granted usershare privileges to create

# public shares, not just authenticated ones

   usershare allow guests = yes



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



# Un-comment the following (and tweak the other settings below to suit)

# to enable the default home directory shares.  This will share each

# user's home directory as \\server\username

;[homes]

;   comment = Home Directories

;   browseable = no



# By default, the home directories are exported read-only. Change the

# next parameter to 'no' if you want to be able to write to them.

;   read only = yes



# 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



# By default, \\server\username shares can be connected to by anyone

# with access to the samba server.  Un-comment the following parameter

# to make sure that only "username" can connect to \\server\username

# This might need tweaking when using external authentication schemes

;   valid users = %S



# 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

;   read only = yes

;   share modes = no



# Un-comment the following and create the profiles directory to store

# users profiles (see the "logon path" option above)

# (you need to configure Samba to act as a domain controller too.)

# The path below should be writable by all users so that their

# profile directory may be created the first time they log on

;[profiles]

;   comment = Users profiles

;   path = /home/samba/profiles

;   guest ok = no

;   browseable = no

;   create mask = 0600

;   directory mask = 0700

Last edited by johnh10000; 11-17-2009 at 05:58 PM. Reason: for got to give ya the conf
 
Old 11-17-2009, 06:14 PM   #2
cyent
Member
 
Registered: Aug 2001
Location: ChristChurch New Zealand
Distribution: Ubuntu
Posts: 398

Rep: Reputation: 87
Debug like so...

Check you can ping from one to the other. No ping, no work...

Suppose the two machines are called foo and bah..

foo> ping bah
go to other machine...
bah> ping foo

If that worked. Grreat. If it didn't there's your problem right there. Network does Not Work.

Now look at the output of dmesg and see if you can get some clues. (Paste anything samba related here)

Then
sudo bash
cd /var/log/samba
ls -lrt
and look at anything interesting / juicy there. Paste here so we can help.
 
Old 11-17-2009, 06:43 PM   #3
mejohnsn
Member
 
Registered: Sep 2009
Posts: 174

Rep: Reputation: Disabled
Quote:
Originally Posted by cyent View Post
Debug like so...

Check you can ping from one to the other. No ping, no work...

Suppose the two machines are called foo and bah..

foo> ping bah
go to other machine...
bah> ping foo

If that worked. Grreat. If it didn't there's your problem right there. Network does Not Work.

Now look at the output of dmesg and see if you can get some clues. (Paste anything samba related here)

Then
sudo bash
cd /var/log/samba
ls -lrt
and look at anything interesting / juicy there. Paste here so we can help.
Since this is a 'newbie' forum, you might want to explain what 'dmesg' is and how to extract from its output the "anything samba related".
 
Old 11-17-2009, 06:55 PM   #4
cyent
Member
 
Registered: Aug 2001
Location: ChristChurch New Zealand
Distribution: Ubuntu
Posts: 398

Rep: Reputation: 87
Quote:
Originally Posted by mejohnsn View Post
Since this is a 'newbie' forum, you might want to explain what 'dmesg' is and how to extract from its output the "anything samba related".
Open up a terminal window and at the prompt type dmesg
myname@mybox:~$ dmesg

It's going to splat a thousand log messages all over your screen. Alas, most of them won't concern samba.

You can either filter out irrelevant jabber. For example my logs have too much cruft relating to fetchmail and usb.

dmesg | grep -viE 'fetchmail|usb'


Or filter it though "less" and explore it on your own.

dmesg | less

Or do both...

dmesg | grep -viE 'fetchmail|usb' | less

Or look for anything directly samba or nmb related.

dmesg | grep -iE 'samba|nmb' | less

Incidentally, that's a useful trick to see what _is_ actually set on in your samba config file less all the comment fluff...

grep -vE '^[:space:]*([#;]|$)' /etc/samba/smb.conf

Even so, that's going at things way too fast for a trubie newbie... so if any newbie didn't follow that (and cares) just ask.

Last edited by cyent; 11-17-2009 at 06:59 PM.
 
Old 11-17-2009, 07:12 PM   #5
johnh10000
Member
 
Registered: Nov 2008
Distribution: Ubuntu Lucid Lynx
Posts: 541

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by cyent View Post
Open up a terminal window and at the prompt type

Even so, that's going at things way too fast for a trubie newbie... so if any newbie didn't follow that (and cares) just ask.
To be fair anm not a true newbie, just a bit stuck on this.

the dmsg thing didn't mention samba or nmb, and the clean smaba..conf is
Code:
[global]
	log file = /var/log/samba/log.%m
	usershare owner only = false
	socket options = TCP_NODELAY
	obey pam restrictions = yes
	null passwords = yes
	map to guest = bad user
	interfaces = 127.0.0.0/255.0.0.0 eth0
	passdb backend = tdbsam
	dns proxy = no
	printing = cups
	server string = %h server (Samba, Ubuntu)
	default = global
	unix password sync = yes
	workgroup = WORKGROUP
	os level = 20
	printcap name = cups
	syslog = 0
	usershare allow guests = yes
	panic action = /usr/share/samba/panic-action %d
	max log size = 1000
	pam password change = yes
[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   create mask = 0700
[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = yes
[cdrom]
   comment = Samba server's CD-ROM
   read only = yes
   locking = no
   path = /cdrom
   guest ok = yes
[ebassy]
	delete readonly = yes
	writeable = yes
	public = yes
	path = /home/ebassy
 
Old 11-17-2009, 07:21 PM   #6
cyent
Member
 
Registered: Aug 2001
Location: ChristChurch New Zealand
Distribution: Ubuntu
Posts: 398

Rep: Reputation: 87
Hmm. Is all the bits of samba installed on the second machine?

sudo /etc/init.d/samba status
* nmbd is running
* smbd is running

ps auxw | grep -iE '[sn]mb'
root 18556 0.0 0.0 8440 1344 ? Ss Oct19 6:29 /usr/sbin/nmbd -D
root 18559 0.0 0.0 14548 1972 ? Ss Oct19 0:00 /usr/sbin/smbd -D
root 18563 0.0 0.0 14244 432 ? S Oct19 0:00 /usr/sbin/smbd -D

What about /var/log/samba/* any clues / error messages there?

Else it's time just to march through...
http://www.samba.org/samba/docs/man/...diagnosis.html
step by step until you see the problem.

Sigh! Samba is _way_ too configurable and complex in my opinion.
 
Old 11-17-2009, 07:35 PM   #7
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Rep: Reputation: 203Reputation: 203Reputation: 203
hostnames

I couldn't tell if you were being colorful or if you were trying to do everything with hostnames rather than IP addresses. If that's what you were trying to do, then give it a whirl with the IP addresses. If all goes well that way it's likely host resolution which can be fixed by editing /etc/hosts to include tux and friends.
 
Old 11-17-2009, 07:36 PM   #8
johnh10000
Member
 
Registered: Nov 2008
Distribution: Ubuntu Lucid Lynx
Posts: 541

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by cyent View Post
Hmm. Is all the bits of samba installed on the second machine?
well till you guys mentioned it, nmb was never running, it is now!

Sigh! Samba is _way_ too configurable and complex in my opinion.[/QUOTE]

I think that was it, the only problem I have now, is to get onto the win7 (lappy) which is insisting on a password eventhough there isn't one!

cheers
 
Old 11-17-2009, 07:38 PM   #9
johnh10000
Member
 
Registered: Nov 2008
Distribution: Ubuntu Lucid Lynx
Posts: 541

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by damgar View Post
I couldn't tell if you were being colorful or if you were trying to do everything with hostnames rather than IP addresses. If that's what you were trying to do, then give it a whirl with the IP addresses. If all goes well that way it's likely host resolution which can be fixed by editing /etc/hosts to include tux and friends.
Huh? It's just the out of the box config file I thought with the printer cd and a few shares turned on
 
Old 11-17-2009, 07:58 PM   #10
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Rep: Reputation: 203Reputation: 203Reputation: 203
Were you trying to connect to the server by it's IP address (192.168.x.x) or were you trying to connect by it's hostname (tux, tux2, lappy)? If you were just using the network browse feature then you were doing things by hostname. I've had trouble with linux not being consistent in identifying the hostnames of remote systems. In order to make it 100% accurate I modified the file /etc/hosts. That file maps IP addresses to hostnames a sample would be:
PHP Code:
127.0.0.1    localhost
127.0.1.1    DELL
192.168.1.101    dtest
192.168.1.102    dlin
192.168.1.104    DELL 
That's my /etc/hosts file on this machine.
 
Old 11-17-2009, 08:18 PM   #11
johnh10000
Member
 
Registered: Nov 2008
Distribution: Ubuntu Lucid Lynx
Posts: 541

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by damgar View Post
Were you trying to connect to the server by it's IP address (192.168.x.x) or were you trying to connect by it's hostname (tux, tux2, lappy)? If you were just using the network browse feature then you were doing things by hostname. I've had trouble with linux not being consistent in identifying the hostnames of remote systems. In order to make it 100% accurate I modified the file /etc/hosts. That file maps IP addresses to hostnames a sample would be:
PHP Code:
127.0.0.1    localhost
127.0.1.1    DELL
192.168.1.101    dtest
192.168.1.102    dlin
192.168.1.104    DELL 
That's my /etc/hosts file on this machine.
I was trying to connect via windows share names
 
Old 11-17-2009, 09:01 PM   #12
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Rep: Reputation: 203Reputation: 203Reputation: 203
Try editing `/etc/hosts`. It has ended days of "WTF?!?!?!?!" for me personally.

I use joe so in a terminal I would type:

sudo joe /etc/hosts
MYPASSWORD when prompted

arrow down to the bottom, modify according to the template you'll see for the 127.x.x.x filling in the hostnames. I include all the hosts including the one I'm editing. Hit enter to close the line, save the file (with joe it's ctrl+k+x) and reboot.

You probably don't have joe. vi is default for ubuntu I think. It takes half a second to install with synaptic. it's got a command menu which makes it easy to use for a newbie like me.
 
Old 11-18-2009, 04:45 AM   #13
johnh10000
Member
 
Registered: Nov 2008
Distribution: Ubuntu Lucid Lynx
Posts: 541

Original Poster
Rep: Reputation: 33
more problems

It works fine on tux2, and ebassy-pc, print and file sharing the works.

When I click on the network icon on tux, I get windows-networks icon, click on it I get WORKGROUP icon, click on that and unable to mount location, failed to retrive share list from server.

As suggested last night.

johnh10000@tux:~/cam$ ps auxw | grep -iE '[sn]mb'
1000 4474 0.0 1.4 22956 3604 ? S 10:10 0:00 /usr/lib/gvfs/gvfsd-smb-browse --spawner :1.4 /org/gtk/gvfs/exec_spaw/5
root 6036 0.0 0.5 8248 1340 ? Ss 10:19 0:00 /usr/sbin/nmbd -D
root 6039 0.0 0.5 14064 1476 ? Ss 10:19 0:00 /usr/sbin/smbd -D
root 6042 0.0 0.3 14064 820 ? S 10:19 0:00 /usr/sbin/smbd -D
johnh10000@tux:~/cam$ Processing '/etc/joe/editorrc'...Processing '/etc/joe/ftyperc'...done
done

I have attached the log files generated this morning.

Any ideas, or for tux, should I go for nfs?

Last edited by johnh10000; 10-31-2010 at 05:50 AM.
 
Old 11-18-2009, 04:53 AM   #14
johnh10000
Member
 
Registered: Nov 2008
Distribution: Ubuntu Lucid Lynx
Posts: 541

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by johnh10000 View Post
It works fine on tux2, and ebassy-pc, print and

I have attached the log files generated this morning.

Any ideas, or for tux, should I go for nfs?
well I have just tried using connect to server, and with a few tweaks I can indeed connect to ebassy-pc.

So now its not as important, but why won't it work the usual way?
 
Old 11-18-2009, 02:32 PM   #15
cyent
Member
 
Registered: Aug 2001
Location: ChristChurch New Zealand
Distribution: Ubuntu
Posts: 398

Rep: Reputation: 87
Quote:
Originally Posted by johnh10000 View Post
I have attached the log files generated this morning.

Any ideas, or for tux, should I go for nfs?
I bet this line from your log file is a source of woe...

Quote:
can't open username map /etc/samba/smbusers. Error No such file or directory
Don't forget there are two entirely independent notions of identity/authentication/authorization running around. The Windows / Samba username/password/permissions and the Unix/linux username/password/permissions.

smbusers is how the one is mapped to the other.
 
  


Reply



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
Probably daft questions! CtrlAltDelete Again Ubuntu 4 02-27-2009 09:52 AM
This has got be a daft question.. how do I log in??? pilot11 Linux - Newbie 24 10-02-2006 02:37 AM
daft desktop / gnome question gsd750 Linux - Newbie 2 09-10-2004 10:55 AM
yet another daft floppy problem Bungholio Linux - General 5 07-07-2003 01:34 PM
Another daft newbie question Scamps Linux - Newbie 2 11-24-2001 01:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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
Open Source Consulting | Domain Registration