LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 10-25-2007, 07:38 AM   #1
vega2k
LQ Newbie
 
Registered: Oct 2007
Location: 127.0.0.1
Distribution: Ubuntu 7.10, Debian 4.0
Posts: 13

Rep: Reputation: 0
Samba doesn't work with users


Hello, I have tried to configure samba but I get this error "session setup failed: NT_STATUS_LOGON_FAILURE" when I try to connect to the server then I have "security=user" option on but then I set "security=share" I can connect to the server but only public folders.
I have added the user I try to logon to in the smb user/password file and added the user to the main Unix system.
I hope someone can help me with this because it's the first time I'm setting up Linux almost myself. ^.~
My system is running, Ubuntu 7.10.

smb.conf
Code:
[global]
    # General server settings
    netbios name = server
    server string =
    workgroup = homenetwork.com
;    wins support = yes
    dns proxy = no

    panic action = /usr/share/samba/panic-action %d
    log file = /var/log/samba/log.%m
    max log size = 1000
    syslog = 1

;    security = share
    security = user
    username map = /etc/samba/smbusers
    encrypt passwords = true
    passdb backend = tdbsam
    obey pam restrictions = yes
    invalid users = root

;   unix password sync = no
    passwd program = /usr/bin/passwd %u
    passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n *passwd:*password\supdated\ssuccessfully$

    announce version = 5.0
    socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192

[shared]
    comment = winshare
    path = /samba/
    public = yes
    writable = yes
    public = yes
    writable = yes
    public = yes
    writable = yes 
    valid users = vega2k
    create mask = 0744 
    directory mask = 0755
    admin users = admin
    force user = nobody
    force group = nogroup
 
Old 10-25-2007, 08:04 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Tdbsam is a password backend database that is used instead of the flat text file, smbpasswd. You are storing the account info in smbpasswd but samba is looking in the database file for that info

Quote:
I have added the user I try to logon to in the smb user/password file
Use the "smbpasswd" program to add a user and enter the password into the /etc/samba/smbpasswd file.

sudo smbpasswd -a vega2k
New SMB password:
Retype new SMB password:
Added user vega2k.

Last edited by jschiwal; 10-25-2007 at 08:09 AM.
 
Old 10-25-2007, 08:40 AM   #3
vega2k
LQ Newbie
 
Registered: Oct 2007
Location: 127.0.0.1
Distribution: Ubuntu 7.10, Debian 4.0
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jschiwal View Post
Tdbsam is a password backend database that is used instead of the flat text file, smbpasswd. You are storing the account info in smbpasswd but samba is looking in the database file for that info


Use the "smbpasswd" program to add a user and enter the password into the /etc/samba/smbpasswd file.

sudo smbpasswd -a vega2k
New SMB password:
Retype new SMB password:
Added user vega2k.
Think I got it. I will make some changes now and see if I get it working will post soon again after some testing. ^^

Update:
It's working then I change the .conf file to this and used smbpasswd.

Now I got another 3 question about samba.
1. I share a full harddrive and on it I have the folder lost+found, is there someway to hide this folder so it can't been seen?
2. And cane I set premisson so they can write to all folders that I share exept lost+found?
3. Then I look at the share disk from windows it say it's only 7.3 GB big but it's really 200 GB big and if I so "df -la" it's also say that the drive is 200 GB.

Code:
[global]
    # General server settings
    netbios name = server
    server string =
    workgroup = homenetwork.com
    wins support = yes
    dns proxy = no

    panic action = /usr/share/samba/panic-action %d
    log file = /var/log/samba/log.%m
    max log size = 1000
    syslog = 1


    security = user
    encrypt passwords = true
    passdb backend = tdbsam
    obey pam restrictions = yes
    invalid users = root

    passwd program = /usr/bin/passwd %u
    passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n *passwd:*password\supdated\ssuccessfully$

    socket options = TCP_NODELAY

[shared]
    comment = winshare
    path = /samba/
    public = yes
    writable = yes
    public = yes
    valid users = vega2k
    create mask = 0744 
    directory mask = 0755
    admin users = admin
    force user = nobody
    force group = nogroup

Last edited by vega2k; 10-25-2007 at 08:58 AM. Reason: Working but 3 new questions
 
Old 10-25-2007, 02:28 PM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
You may have posted and earlier smb.conf file. It still uses the tdbsam backend. That would be OK if you used it instead of smbpasswd but from your description that isn't the case. You can simply delete this line from the config to use the default.

I don't think you need "valid user" and nobody and "force user" together. If the permissions are set correctly on the directory you are sharing, it should be sufficient to use "public = yes" and "writable = yes". Be sure to set the "sticky bit" on a world writable directory. The permissions will probably match that of the /tmp directory for a public writable share.

Look at installing the samba-doc package. It supplies books and manpages that you will find useful including "Samba 3 By Example" and the "Samba 3 Howto and Reference Guide". If you don't have these packages, you can download the books from the samba.org website. Look in /usr/share/doc/packages/samba or /usr/share/doc/samba-<version>/ to see if you already have these books on your computer.

The first will even go step by step in creating the directory to be shared including setting the ownership and permissions. If the directory you are sharing occupies an entire partition, consider using the "noexec", "nodev" and "nosuid" mount options when mounting it in Linux. This will make certain potential abuses more difficult.

You don't need the lost&found directory. Check if it is empty and delete it as root if it is. Also search the smb.conf man page for "hide files =". That is another way of hiding lost&found. There is also an option to hide dot files and map hidden files to dot files.

Good Luck!

Last edited by jschiwal; 10-25-2007 at 02:29 PM.
 
  


Reply

Tags
samba


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Samba doesn't work with users vega2k Linux - Networking 1 10-26-2007 04:10 AM
Active directory users to Samba users alexpacio Linux - Networking 0 05-19-2006 08:44 AM
I can't add users to "samba users" in control center g_jakes Linux - Security 3 05-20-2005 02:10 PM
can't add users to "samba users" in control center g_jakes Linux - Networking 1 05-20-2005 01:28 PM
can't add users to "samba users" in control center g_jakes Linux - Wireless Networking 1 05-20-2005 01:27 PM


All times are GMT -5. The time now is 05:57 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration