LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 11-07-2008, 05:48 AM   #1
Dmulec
LQ Newbie
 
Registered: Nov 2008
Posts: 5

Rep: Reputation: 0
[Samba] Synching /etc/passwd with smbpasswd


Hello! First off, sorry for my bad english, english is like my 3rd language.

Anyway, I'm currently working on getting a Samba server to work with user security level. The OS I'm using is Debian 4 Etch.

I'm supposed to be able to sync the samba users passwords with /etc/passwd, but how?

In smb.conf I found these lines
Quote:
passwd program = /usr/bin/passwd %u
passwd chat= *Enter\snew\sUnix\spassword:* %n\n *Retype\snew\sUnix\password:* %n\n *password\supdated\ssuccessfully* .
But I don't understand how to use it T_T Do I have to put them in a certain script or what?

And I found out I have to have a smb passwd file, so I defined it in the smb.conf with

Quote:
smb passwd file = /etc/samba/smbpasswd
When I try to change the linux user password by doing
/usr/bin/passwd name
I can change the linux password fine, but it doesn't write into the above defined /etc/samba/passwd.

Can anyone help me? I've been googling the past 2 days and looked around many forums, but so far I didn't find an answer ;;. All I found so far were outdated things from 1998, which don't contain any useful info anyway.
 
Old 11-10-2008, 04:34 AM   #2
Dmulec
LQ Newbie
 
Registered: Nov 2008
Posts: 5

Original Poster
Rep: Reputation: 0
Bump. I still need help ;-;
 
Old 11-10-2008, 06:31 AM   #3
salter
Member
 
Registered: Oct 2008
Posts: 100

Rep: Reputation: 15
Passwords for Linux accounts and for Samba accounts are handled separately. Changing a UNIX account password doesn't affect the Samba passwords, and vice versa.

To set UNIX passwords you enter on the command-line:
# passwd <user-name>

To set Samba passwords you enter on the command-line:
# smbpasswd <user-name>

Pass the same password in both cases for the same user-name.

Note: Having a username like 'Joe' as a UNIX account doesn't mean that it's the same 'Joe' as used for Samba. To the system these are simply unrelated similar entries.

Last edited by Tinkster; 10-30-2010 at 06:16 PM.
 
Old 11-10-2008, 08:22 AM   #4
Dmulec
LQ Newbie
 
Registered: Nov 2008
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by salter View Post
Passwords for Linux accounts and for Samba accounts are handled separately. Changing a UNIX account password doesn't affect the Samba passwords, and vice versa.

To set UNIX passwords you enter on the command-line:
# passwd <user-name>

To set Samba passwords you enter on the command-line:
# smbpasswd <user-name>

Pass the same password in both cases for the same user-name.

Note: Having a username like 'Joe' as a UNIX account doesn't mean that it's the same 'Joe' as used for Samba. To the system these are simply unrelated similar entries.
But the new Samba only allows usernames that exist in /etc/passwd, and I know that it's possible to sync the passwords (when you change the password in smbpasswd it will be changed in /etc/passwd as well), but the question is, how ;;

EDIT: Well more importantly, how do I make it so the smbpasswd command by default writes into /etc/samba/smbpasswd?

Last edited by Dmulec; 11-10-2008 at 08:29 AM.
 
Old 11-10-2008, 09:59 AM   #5
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,423

Rep: Reputation: 1158Reputation: 1158Reputation: 1158Reputation: 1158Reputation: 1158Reputation: 1158Reputation: 1158Reputation: 1158Reputation: 1158
Easily the best way to handle this is to configure Samba to use PAM. ("PAM" = "Pluggable Athentication Modules.")

PAM is a standard system that's used in most Linux installations that I have seen, although it is seldom talked-about except in advanced configurations. Read about it here and here.

The essential idea behind PAM is that "every application needs to do authentication, and wouldn't it be really nice if we could channel all those requests in such a way that all of our apps could use just one system that we could then easily "tweak?" PAM is such a system.

Often, in large installations, centralized directory services such as LDAP (a.k.a. Microsoft "Active Directory") are used to enable the various authentication and authorization requirements to be handled in one place. (PAM, of course, can use LDAP, or Kerberos.) But this admonition, found here, is very telling:
Quote:
Do not rush into an LDAP deployment. Take the time to understand how the design of the Directory Information Tree (DIT) may impact current and future site needs, as well as the ability to meet them. The way that Samba SAM information should be stored within the DIT varies from site to site, and with each implementation new experience is gained. It is well understood by LDAP veterans that: 'first implementations create awakening, second implementations of LDAP create fear, and third-generation deployments bring peace and tranquility.'
 
  


Reply

Tags
samba, smbpasswd


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
passwd sync smbpasswd slack66 Linux - Networking 1 04-24-2009 11:01 AM
adding users using smbpasswd, or synchronise passwd/smbpasswd gyodai Linux - Networking 2 03-11-2009 03:47 PM
passwd, smbpasswd sync with smb and linux users maginotjr Linux - Server 2 03-05-2008 01:08 PM
passwd smbpasswd migration Cottsay Linux - Software 2 05-10-2007 08:54 PM
sync passwd to smbpasswd??? slack66 Slackware 2 12-27-2004 01:15 AM


All times are GMT -5. The time now is 09:42 AM.

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