Setting up Samba?

I just installed the 'samba' app, used that to add my folders I want to share then using the gnome network manager added a wired DHCP connection with DHCP client ID name same as my computer name and bam it works.
 
My brain is melting.

@fskmh, I'll look through that stuff on the PC a bit later, someone previously asked about my smbpasswd file, and I said it does not exist on my PC, don't know why. I did run smbpasswd and it seemed to work.

The /etc/samba/private/ dir does not exist on my machine AFAIK.

I'm thinking maybe I should clean out my samba install and try start afresh. DO you think I should do that or just continue to try fix what I already have?

If I do remove it what's the best way? (I'd rather not have to re-install xubuntu, as I've already done at least 100mb of updates.)

@web, not tried webmin, also came across something else that mentioned a samba configuration util, but can't find that one. Would rather use xubuntu than mandriva, if for no other reason than I already have xubuntu downloaded.
 
No, a small thing like this doesn't call for a reinstall. Did you remember to do 'smbpasswd -a' (for add)?
 
Yes. It wouldn't work at first though. Somehow (can't remember right now) I got it to work, it said something about creating a user successfully I'm sure. Maybe it didn't work then. :p

If I wanted to re-install it, should I just remove it with synaptic, will that remove everything for it and not leave behind perhaps any of the stuff that I may have messed up? I'll try see if I can sort it out a bit more though.
 
You can configure the log files in your config file. There doesn't appear to be an entry in your config file for it though. According to your post:
<snip>
# 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
<snip>


Umm, okay where are the log files? Hopefully in the /etc/samba dir or something I guess.
Log files are usually stored in /var/log/. samba has more than one log file, so it creates a subdirectory called samba (/var/log/samba/)

do an ls on the dir and find the log file that samba logs to when you try to access the share (check the time stamp):
Code:
ls -al /var/log/samba

now tail the file so that you can see the changes as they happen:
Code:
tail -f /var/log/samba/thefilename.log

The /etc/samba/private/ dir does not exist on my machine AFAIK.
Check as root:
Code:
sudo ls -al /etc/samba/

I'm thinking maybe I should clean out my samba install and try start afresh. DO you think I should do that or just continue to try fix what I already have?

If I do remove it what's the best way? (I'd rather not have to re-install xubuntu, as I've already done at least 100mb of updates.)
Stick with what you have. I doubt it would make any difference if you re-install since the password files, user accounts and permissions will stay behind and deleting those is probably not a good idea.

Don't change distro's for one application... the feature is probably not even distro specific but a feature of the desktop environment or file manager, which can be installed on any distro.

I consider myself to have at least moderate knowledge of PCs, but this linux stuff is confusing the hell out me. :p I'm totally flying blind here.
Yeah, it is a little confusing at first. I'm surprised you haven't given up yet... stick it out, eventually (some of) it will make sense :)

It is difficult initially but once you've done it a few times it is quite easy. By making something user-friendly, you have to hide functionality (Windows)... most Linux applications give you full control over all the available functionality.

The only way to assist you is with log entries.
 
well here is what i did, it doesn't need any username or password just use the samba.conf file of the document not the setups and all...

Sorry didn't read through the whole thread but hope this can help...
 
Okay I found a whole lot of stuff in /var/log/samba, I haven't yet tailed the log file in order to see what's happening, I appear to have broken something last time 'cos now I can't see the xubuntu machine shares from my windows machine anymore.

I'm going to go back through the samba config file and try to put it back to the way it was, just in case is there somewhere I can get an "original" config file from, or some way to restore it to defualt or something?

Code:
sudo ls -al /etc/samba/

I only see,

gdbcommands
smb.conf
smbusers

If you have a look at my .conf that I posted, in the networking section there was some extra stuff that I added. To be able to see the xubuntu box from windows I had to remove those lines. Then I could see the machine in workgroup, but got an access denied message.

After a while I tried again (not modifying anything) and I get the password pop-up. Entering the username and password (I think I remember them) does nothing like before, the box just immediately re-appears.

Then after a while it went back to just giveing access denied.

I then checked the /var/log/samba dir like you said, but can't see any files that have been modified at the corresponding time. There are lots of logs though. Some from today, but not at the right times.

Not exactly sure what I should do next. Will keep trying.
 
Last edited:
I'm wondering if how I set up my network is affecting me here? Don't know if I've done it in the ideal way, if it has no bearing on getting samba to wokr just disregard the following.

First thing I did after install was open the network config thing at the top right. Editing Netwrok connections.

There under wired it had Auto eth0, which I edited to manual and set a static ip etc. It worked and I was able to get on the net. After a restart I noticed that it hadn't kept the setting.

I added a new wired called LAN instead with my settings (I had to copy the MAC address from Auto eth0 to LAN to make it work too), and just connect it manually when I want the LAN. It keeps that LAN connection. I also added "DSL" connections (presume pppoe) for my telkom acc. for local use, and a few other accounts that I have.

So when I want to use the account in my router I nable LAN, otherwise I enable one of the other accounts, but then obviously have no lan access. It's beyond the scope of what I want to do now, can I set it up so that I can use my pppoe or "DSL" connections and still keep my LAN enabled?

The issue from before of it sometimes showing me the password screen from windows and sometimes not is to do with the above. When LAN is enabled I get the screen, when it's not I don't. I'm sure it didn't make a difference to the logs being modified but I'll look again at that (I think I have tried it both ways already).

The user I have created with smbpasswd is called "suser", and my smbusers file looks like,

Code:
user - "suser"

is that right? The normal account on my xubuntu box is called "user" as it is on my XP machine (not very imagineative I know, just quick to type :p)

As I said I am missing the /etc/samba/private/ dir as established in my previous post, not sure if that is the main issue here. I'll keep messing around.
 
The logs don't seem to update all the time, as I'm attempting to connect, I presumed they would do so each time.

I have 4 log files that seem to be updated around the right time, at the same time, or very close together anyway.

log.mesa (mesa is my windows machine)
log.nmbd
log.smbd
log.winbindd-idmap

I'll show you the results of "tail" for each:

Code:
 log.mesa

user@D800:/var/log/samba$ tail log.mesa
  getpeername failed. Error was Transport endpoint is not connected
  write_data: write failure in writing to client 0.0.0.0. Error Connection reset by peer
[2008/11/27 21:50:08,  0] smbd/process.c:srv_send_smb(74)
  Error writing 4 bytes to client. -1. (Transport endpoint is not connected)
[2008/11/28 01:15:44,  0] lib/util_sock.c:write_data(1059)
[2008/11/28 01:15:44,  0] lib/util_sock.c:get_peer_addr_internal(1596)
  getpeername failed. Error was Transport endpoint is not connected
  write_data: write failure in writing to client 0.0.0.0. Error Connection reset by peer
[2008/11/28 01:15:44,  0] smbd/process.c:srv_send_smb(74)
  Error writing 4 bytes to client. -1. (Transport endpoint is not connected)

Code:
 log.nmbd

user@D800:/var/log/samba$ tail log.nmbd
  reload_interfaces: No subnets to listen to. Waiting..
[2008/11/28 01:18:09,  0] nmbd/nmbd.c:terminate(68)
  Got SIGTERM: going down...
[2008/11/28 01:18:13,  0] nmbd/nmbd.c:main(849)
  nmbd version 3.2.3 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2008
[2008/11/28 01:18:13,  1] param/params.c:Parameter(377)
  params.c:Parameter() - Ignoring badly formed line in configuration file: express#
[2008/11/28 01:18:13,  1] param/params.c:Parameter(377)
  params.c:Parameter() - Ignoring badly formed line in configuration file: express#

Code:
 log.smbd

user@D800:/var/log/samba$ tail log.smbd
  params.c:Parameter() - Ignoring badly formed line in configuration file: express#
[2008/11/27 21:50:08,  0] lib/util_sock.c:get_peer_addr_internal(1596)
  getpeername failed. Error was Transport endpoint is not connected
[2008/11/28 01:18:13,  0] smbd/server.c:main(1213)
  smbd version 3.2.3 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2008
[2008/11/28 01:18:13,  1] param/params.c:Parameter(377)
  params.c:Parameter() - Ignoring badly formed line in configuration file: express#
[2008/11/28 01:18:13,  1] param/params.c:Parameter(377)
  params.c:Parameter() - Ignoring badly formed line in configuration file: express#

Code:
 log.winbindd-idmap

user@D800:/var/log/samba$ tail log.winbindd-idmap
[2008/11/28 01:18:14,  1] winbindd/idmap_tdb.c:idmap_tdb_alloc_init(371)
  idmap uid range missing or invalid
  idmap will be unable to map foreign SIDs
[2008/11/28 01:18:14,  0] winbindd/idmap.c:idmap_alloc_init(831)
  ERROR: Initialization failed for alloc backend, deferred!
[2008/11/28 01:18:14,  1] winbindd/idmap_tdb.c:idmap_tdb_alloc_init(371)
  idmap uid range missing or invalid
  idmap will be unable to map foreign SIDs
[2008/11/28 01:18:14,  0] winbindd/idmap.c:idmap_alloc_init(831)
  ERROR: Initialization failed for alloc backend, deferred!

When I log in from windows what user name should I be using, the one created during this process (I think so), the main one on my linux box, or the one from my windows box? I have tried them all anyway.
 
not sure about the gui networking config in Xubuntu, I normally edit the network config files directly. the ones you are interested in is:
/etc/network/interfaces (network interface config)
/etc/resolv.conf (DNS configuration)

The ADSL connection is just another network interface.

If your other machine also has a static IP (recommended), add a entry for it in /etc/hosts
Code:
x.x.x.x               mesa
Obviously replace x.x.x.x with mesa's IP.

It does look like you might have some routing issue, but I'm not sure.

Not serious, but remove the malformed line in the config file:
express#

A google search for the error (write failure in writing to client 0.0.0.0. Error Connection reset by peer) revealed a possible solution:
try adding the following in your smb.conf file's global section.
smb ports = 139
then restart smb.

It is usually not necessary to restart the entire machine when making changes, but sometimes it helps, especially when you are messing with routes (network interfaces).

I wouldn't use something like user as a username... it might be a reserved word. The username on the Windows box and samba server need not be the same.

Something else that could be messing you around is the fact that you cannot to a windows share using more than one username. windows does not always give you a proper error message, so I normally use the command prompt to test:
Code:
net use x: \\yourserver\yourshare thepassword /USER:yourusername
this will map a network drive x:
to delete:
Code:
net use x: /DELETE

you can also view shares:
Code:
net view \\yourserver

you can substitute yourserver with the IP of the samba server to make sure name resolution is not causing any problems.
 
All that's in interfaces is,

Code:
auto lo
iface lo inet loopback

and resolve.conf,

Code:
+
#Generated by NetworkManager
nameserver 192.168.192.1

I added the entry for my other machine to hosts, that machine does have a static ip. Also removed that line from samba.conf, and added the smb ports = 139 one, I added it right at the beggining of [global], is that okay?

Unfortuneately the username is already user (set that when I installed xubuntu), don't know how to change it, I would have thought that if it was reserved it would have said so. Also no other problems in windows with that so far anyway

for this bit,

Code:
net use x: \\yourserver\yourshare thepassword /USER:yourusername.

that should be the password and username of the account created for samba right?

When I try that I get,

Code:
System error 1326 has occurred.

Logon failure: unknown user name or bad password.

I tried this,

Code:
net use x: \\yourserver\yourshare thepassword /USER:root

which worked, the x: drive appeared in explorer, but I only got access denied when trying to access it. Obvioulsy I don't want to do it that way anyway though.

When I go into users and groups under system, I noticed that in permissions I could grant sharing files and folders and connecting to networks, should that have an affect? None were enabled default and changing them didn't seem to help at all.

Another thing that I've noticed since doing some more today is that I can no longer see the password screen when trying to access the samba copmuter from windows, I made sure that my LAN connection was enabled, and this was before messing around with other stuff now that I noticed it. Don't know why it's behaviour has suddenly changed.

BTW I noticed that the GUI network thing is called NetworkManager (oddly enough) looking intoit a bit.
 
Last edited:
Bump and double post.

Still haven't made any progress on this, can anyone else see what's happening here?
 
yes, use the samba username and password. not working doesn't really mean anything to me, show me the logs!

I don't see any harm in adding your user to those groups. changing user properties only takes affect on login, so if you are logged in you will need to log out and back in again!!

there is no magic fix. don't try random things or you will probably never get it working. the logs will tell you what is wrong. take it one error at a time:
make one change
restart the service
post logs

Bump and double post.

Still haven't made any progress on this, can anyone else see what's happening here?

Oh, so my help is not good enough any more? :D Sorry, I don't have much time to spend on the forums...
 
yeah, what Peder said. didn't know about testparm... I always checked for errors manually!

please post the output of testparm!
 
you know i did make a server although it was a open server without any authentication, anyone on my network can access the server without having to type in a password...

I made a thread about it, the link is in this thread somewhere...
 
Ja Peder, I saw that when you posted in this thread before. I'll look at it some more, it's just not exactly what I'm looking to do. Not just fobbing off your suggestion, promise. :p

I just want some password protected shares on my xubuntu system, I'll probably only access them from one other machine, but to be able to get them from others is a bonus.

Will try the testparm thing soon.
 
i also put the place i got it from, so maybe that will help you, i am on a open home network and windows is difficult to set up with passwords and stuff..
 
Output from testparm:

Code:
Load smb config files from /etc/samba/smb.conf
Processing section "[printers]"
Processing section "[print$]"
Processing section "[data01]"
Processing section "[data02]"
Processing section "[dump]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
	server string = %h server (Samba, Ubuntu)
	map to guest = Bad User
	obey pam restrictions = Yes
	passdb backend = tdbsam
	pam password change = Yes
	passwd program = /usr/bin/passwd %u
	passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
	username map = /etc/samba/smbusers
	unix password sync = Yes
	syslog = 0
	log file = /var/log/samba/log.%m
	max log size = 1000
	smb ports = 139
	dns proxy = No
	usershare allow guests = Yes
	panic action = /usr/share/samba/panic-action %d

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

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

[data01]
	path = /data01
	guest ok = Yes

[data02]
	path = /data02
	guest ok = Yes

[dump]
	path = /data02/dump
	read only = No
	guest ok = Yes

"map to guest = bad user" looks like it may be a problem, something to do with the samba user not being set up right?
 
Top
Sign up to the MyBroadband newsletter
X