[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

need help configuring samba for no password

Posted on 2012-08-29
14
Medium Priority
?
642 Views
Last Modified: 2012-09-27
Seems like I mess up every samba configuration I touch! I'm trying to configure samba 3.0.25b for no password. Here's the smb.conf I have:

[global]
netbios name = WEBSERVER
   workgroup = WORKGROUP
   security = share
   hosts allow = 192.168.0. 127.
load printers = no
printcap name = /dev/null
printing = bsd
disable spoolss = yes

guest account = ohprso
   log file = /var/log/samba.%m
   max log size = 50
   passdb backend = tdbsam
   socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
   preferred master = yes
   wins support = yes
   dns proxy = no

[website]
path = /srv/tomcat/webapps/ohprs
public = yes
guest ok = yes
guest only = yes
writeable = yes
browseable= yes
printable = no
create mask = 0660

[xfer]
path = /home/ohprs/xfer
public = yes
guest ok = yes
guest only = yes
writeable = yes
browseable= yes
printable = no
create mask = 0660

Open in new window


This is a modified version of a smb.conf, with passwords, that worked. Before, I had 'security = user', and 'valid users' in the service sections, and did not have 'guest ok', or 'guest only' in these sections. The previous version worked, but I had to login in with ID and PW.

Now, when I try to map the drive from my XP workstation, I get the error "An extended error has occured." The contents of my /var/log/samba.192.168.0.46 are:

[2012/08/29 12:17:27, 3] smbd/oplock.c:init_oplocks(863)
  init_oplocks: initializing messages.
[2012/08/29 12:17:27, 3] smbd/oplock_linux.c:linux_init_kernel_oplocks(276)
  Linux kernel oplocks enabled
[2012/08/29 12:17:27, 10] lib/util_sock.c:read_smb_length_return_keepalive(623)
  got smb length of 68
[2012/08/29 12:17:27, 3] lib/access.c:check_access(312)
  check_access: no hostnames in host allow/deny list.
[2012/08/29 12:17:27, 2] lib/access.c:check_access(323)
  Allowed connection from  (192.168.0.46)
[2012/08/29 12:17:27, 6] smbd/process.c:process_smb(1067)
  got message type 0x81 of len 0x44
[2012/08/29 12:17:27, 3] smbd/process.c:process_smb(1068)
  Transaction 0 of length 72
[2012/08/29 12:17:27, 2] smbd/reply.c:reply_special(324)
  netbios connect: name1=WEBSERVER       name2=COMMON1
[2012/08/29 12:17:27, 2] smbd/reply.c:reply_special(331)
  netbios connect: local=webserver remote=common1, name type = 0
[2012/08/29 12:17:27, 5] lib/username.c:Get_Pwnam_alloc(131)
  Finding user common1
[2012/08/29 12:17:27, 5] lib/username.c:Get_Pwnam_internals(75)
  Trying _Get_Pwnam(), username as lowercase is common1
[2012/08/29 12:17:27, 5] lib/username.c:Get_Pwnam_internals(93)
  Trying _Get_Pwnam(), username as uppercase is COMMON1
[2012/08/29 12:17:27, 5] lib/username.c:Get_Pwnam_internals(102)
  Checking combinations of 0 uppercase letters in common1
[2012/08/29 12:17:27, 5] lib/username.c:Get_Pwnam_internals(108)
  Get_Pwnam_internals didn't find user [common1]!

Open in new window


One thing I notice is that it is trying to connect using the username COMMON1, which is the computer name of the XP Workstation I am trying to map from. Why? I have almost this exact same smb.conf in another Linux computer and it appears to use the guest account ID, not the computer name.

My designated guest account: ohprso, is in /etc/passwd and also in the samba password file. I've tried removing 'preferred master' and 'wins support', but that didn't help.


Need help ... again!
0
Comment
Question by:jmarkfoley
  • 6
  • 5
  • 2
  • +1
14 Comments
 
LVL 3

Expert Comment

by:mtsdemo
ID: 38348191
This is know bug.
https://bugzilla.samba.org/show_bug.cgi?id=722

There is a patch at that link.
0
 
LVL 19

Expert Comment

by:bevhost
ID: 38348260
I put this in my config

map to guest = bad user

Then it doesn't matter what credentials you pass,
because if they fail you'll get logged in as guest.
0
 
LVL 19

Expert Comment

by:bevhost
ID: 38348277
For anyone else reading this ticket normally you'd need this too

guest account = nobody

But I see "jmarkfoley" already has it set to something.
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 81

Expert Comment

by:arnold
ID: 38348977
You have passdb=tdbsam
This might suggest that SMb might be configured as a samba
You may need to add the user
Check your other to see whether you have the difference in the passdb.
0
 
LVL 3

Accepted Solution

by:
mtsdemo earned 2000 total points
ID: 38350012
Its a SAMBA 3 bug.
To SAMBA, Machines are users too.
You have no user specified, so your Machine "COMMON1" is being chosen by SAMBA as the user.

Like I said earlier, this is a known bug.
You need to patch samba, and your config will work.
0
 
LVL 1

Author Comment

by:jmarkfoley
ID: 38351109
arnold: not sure I understand your comments ...
> You have passdb=tdbsam
> This might suggest that SMb might be configured as a samba
Configured as a samba ... what?

> You may need to add the user
This user is already in the passdb file

> Check your other to see whether you have the difference in the passdb.
Check my other ... what?

I don't know how to query the password file. man smbpasswd doesn't say how.

mtsdemo: I tried installing an upgraded version of samba (3.6.7) since the 3.5.8 version on another machine seems to work fine. However, I was not successful in the install; could never get nmbd to run, don't really know why.

So, I'll give the patch idea a shot, but I've been to that site you referenced and don't see any link for downloading a patch. Am I missing something?
0
 
LVL 3

Expert Comment

by:mtsdemo
ID: 38351189
0
 
LVL 1

Author Comment

by:jmarkfoley
ID: 38351477
mtsdemo: how about giving me the whole procedure at once. I've not patched anything before so I don't know what to do with the attachment you've referenced.
0
 
LVL 3

Expert Comment

by:mtsdemo
ID: 38351601
Try this

patch -p1 < "downloaded_patch_file"
0
 
LVL 1

Author Comment

by:jmarkfoley
ID: 38351956
patch: **** strip count i is not a number

should I be in some particular working directory?
0
 
LVL 1

Author Comment

by:jmarkfoley
ID: 38352051
Ah, my bad. I did 'patch -p1 patchfile', not 'patch -p1 <patchfile' (stdin) ... let me try again.
0
 
LVL 1

Author Comment

by:jmarkfoley
ID: 38355691
OK, here what I got when I ran 'patch -p1 <patchfile'

1 15:02:49 root@webserver:/etc/samba
> patch -p1 <patchfile
can't find file to patch at input line 8
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: nsswitch/winbindd_ads.c
|===================================================================
|RCS file: /home/cvs/samba/source/nsswitch/winbindd_ads.c,v
|retrieving revision 1.43.2.26
|diff -u -r1.43.2.26 winbindd_ads.c
|--- nsswitch/winbindd_ads.c    13 Oct 2003 14:03:06 -0000      1.43.2.26
|+++ nsswitch/winbindd_ads.c    11 Nov 2003 00:47:53 -0000
--------------------------
File to patch:


Thoughts? This appears to be wanting to patch C source files. Does that seem right?
0
 
LVL 1

Author Closing Comment

by:jmarkfoley
ID: 38441256
As you say - it must be a samba 3 bug. Upgrading the samba version did the trick (still samba 3, though). I was not successful in figuring out the patch thing; probably best! :)
0
 
LVL 3

Expert Comment

by:mtsdemo
ID: 38441289
it drove me nuts too. I also had a hell of time patching. I fumbled through it, but I did not want to drag you through all the thorns I crawled trough.
Its good the update fixed it. When it happened to me, the update was not available so I had to patch.
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month20 days, 2 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question