LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Samba doesn't work with users (https://www.linuxquestions.org/questions/linux-server-73/samba-doesnt-work-with-users-594484/)

vega2k 10-25-2007 07:38 AM

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


jschiwal 10-25-2007 08:04 AM

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.

vega2k 10-25-2007 08:40 AM

Quote:

Originally Posted by jschiwal (Post 2936324)
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


jschiwal 10-25-2007 02:28 PM

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!


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