WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: LANMAN error in Samba  (Read 16182 times)

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
LANMAN error in Samba
« on: April 11, 2011, 09:37:45 AM »
Hi all,

Relearning Samba using this Guide.
http://www.samba.org/samba/docs/man/Samba-Guide/simple.html

Heres the steps i've followed
root#  mkdir /plans
root#  chmod 755 /plans

/usr/local/etc/samba/smb.conf

# Global Parameters
[global]
workgroup = MIDEARTH
security = SHARE
[Plans]
path = /plans
read only = Yes
guest ok = Yes

Verify that the /etc/hosts file contains the following entry:
192.168.1.1   box


root#  smbclient -L localhost -U%
this command works fine, however

root#  smbclient -L server -Uroot%password
this command gives the following error
Code: [Select]
Server requested LANMAN password (share-level security) but 'client lanman auth' is disabled
I get the same error if I preceed the command with sudo

I found a solution here:
http://forums.linuxmint.com/viewtopic.php?f=90&t=35620&start=0

had to add
Code: [Select]
client lanman auth = Yes
lanman auth = Yes
to the [global] section.

Just thought i'd post the situation, and its solution.

Sorry but I don't know the cause.
Live long and prosper.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: LANMAN error in Samba
« Reply #1 on: April 12, 2011, 12:12:06 AM »
Hi remus
Here is a copy of the smb.conf file for my file server if it helps.
http://forum.tinycorelinux.net/index.php?topic=8871.msg48077#msg48077

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
Re: LANMAN error in Samba
« Reply #2 on: April 12, 2011, 06:51:01 AM »
Hi rich,

I had a look at your post and made the following changes.

added a user called nobody with no password

altered my /usr/local/etc/samba/smb.conf file so its now:

Code: [Select]
[global]
workgroup = MSHOME
security = share
client lanman auth = Yes
lanman auth = yes
guest account = nobody

[plans]
path = /home/tc/plans
available = yes
force create mode = 0777
force directory mode = 0777
read only = no
guest ok = yes
use sendfile = yes

I can open the plans share from windows, but can not create a file or folder within it, error is

Unable to create the folder 'New Folder'
Access is denied
Live long and prosper.

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
[Solved]
« Reply #3 on: April 12, 2011, 07:14:10 AM »
Ok, i've found the problem.

The official samba tutorial I am following from:
http://www.samba.org/samba/docs/man/Samba-Guide/simple.html#id2550946

Starts off by directing to create a folder called plans and assigning some permissions
Code: [Select]
root#  mkdir /plans
root#  chmod 755 /plans

If I change that to
Code: [Select]
chmod 777 /plans
It works great !!!
I can access the share without a username and password.

Goes to show, a little knowledge can be dangerous :)
Live long and prosper.

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
Re: LANMAN error in Samba
« Reply #4 on: April 13, 2011, 07:43:35 AM »
I was thinking about the permissions on the folder and I am confused.

I created plans the folder with the tc user.

Is that why the permissions have to be set to 777, because guest account is set to the  nobody user, and the nobody user did not create the folder ?
Live long and prosper.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: LANMAN error in Samba
« Reply #5 on: April 14, 2011, 03:10:58 AM »
Hi remus
Basically the last 7 gives read, write, and execute rights for that folder to everyone, however, it does
not automatically extend to the files in that folder. That means you open the folder to everyone and
can restrict access on a file by file basis if you want to. The three 7's from left to right refer to owner,
group, and anyone. The 7 comes from adding up 4 + 2 + 1 which have the following meanings
4=Read Access
2=Write Access
1=Execute Rights
So changing a 7 to a 4 would make that file or folder read only for the owner, group or user depending
on which 7 you changed. If you want a file to be Executable you must also enable Read Access. That's
a very basic explanation of permissions, google if you want more advanced techniques.

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
Re: LANMAN error in Samba
« Reply #6 on: April 14, 2011, 06:36:42 AM »
thanks for the explanation Rich.

I've got my head around it now.

I've set nobody as the owner of the shared folder

Code: [Select]
sudo chown nobody public
And all the pieces fell into place.
Live long and prosper.

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
Re: LANMAN error in Samba
« Reply #7 on: April 26, 2011, 01:53:52 AM »
does anyone know if a default install of samba on tinycore linux keeps log files ?

Heres my current /usr/local/etc/samba/smb.conf file
Code: [Select]
[global]
workgroup = MSHOME
security = share
client lanman auth = Yes
lanman auth = yes
guest account = nobody

[public]
path = /home/tc/public
read only = no
guest ok = yes

[pdf]
path = /home/tc/pdf
read only = no
guest ok = yes

What i've done so far.
Code: [Select]
sudo find / -name smbd.logand
Code: [Select]
sudo find / -iname smbd.log
I will of course start reading the samba docs regarding setting up my own log dir, I was just wondering if its not included by default.
Live long and prosper.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: LANMAN error in Samba
« Reply #8 on: April 26, 2011, 02:08:14 AM »
Hi remus
Add this to the global section of your conf file

log file=/usr/local/samba/var/smbd.log
# File size in Kb
max log size=50

Then restart Samba like this

sudo /usr/local/etc/init.d/samba restart

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
Re: LANMAN error in Samba
« Reply #9 on: April 26, 2011, 04:26:16 AM »
Thanks for the input rich,

not sure if this is unexpected, I did have to create the var folder first with
Code: [Select]
sudo mkdir /usr/local/etc/samba/var
I can now use one terminal window to monitor the log in real time with
tail -f /usr/local/etc/samba/var/smbd.log

While testing connection commands in a second terminal window with the smbclient command :)
Live long and prosper.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: LANMAN error in Samba
« Reply #10 on: April 26, 2011, 02:48:43 PM »
Hi remus
Sorry, I thought that Samba would create the directory. Thanks for posting the correction.

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
Re: LANMAN error in Samba
« Reply #11 on: April 26, 2011, 11:50:46 PM »
I thought samba would create the folder as well, I had been experimenting with the
Code: [Select]
sudo smb -l /usr/local/etc/samba/var command
Live long and prosper.