LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-21-2013, 06:05 PM   #1
gacanepa
Member
 
Registered: May 2012
Location: San Luis, Argentina
Distribution: Debian
Posts: 205

Rep: Reputation: 27
Add Samba users - match current Unix password (Samba 3.6.6 in Debian Wheezy)


Hi everyone,
I know that for a user to be granted access to a Samba server they need to have a valid UNIX account and a separate Samba password which is stored in the "smb password file", so in fact a user's password for his UNIX account may be different to the password for his Samba account.
Is there a way to 'sync' the passwords so that when I add an user to Samba, it will use by default the Unix password of that user?
Say the account for user 'alice' exists in my server.
When I add her to the list of Samba users
Code:
smbpasswd -a alice
I don't want the following dialog to appear
Code:
New SMB password:
Retype new SMB password:
Added user alice.
But use her Unix password as default.
Is there a way to do this?
 
Old 06-22-2013, 02:35 AM   #2
cliffordw
Member
 
Registered: Jan 2012
Location: South Africa
Posts: 509

Rep: Reputation: 203Reputation: 203Reputation: 203
Hi there,

I assume your Unix passwords are locally stored passwords in /etc/shadow or a similar file for your distro, and not in an external directory of some sort (LDAP/AD/etc). If so, what you're proposing is unfortunately not possible afaik. The reason for this is that the Unix passwords are encrypted with a one way hash (DES/MD5/SHA1/etc), and can't be decrypted to produce the plain text version fo the password again. The password in the smbpasswd file is encrypted using a different algorithm, so to create this from /etc/shadow would require the plain text password.

One alternative that might help to some degree is the Samba "unix password sync" option, which attempts to change the Unix password whenever you change the Samba password. See https://www.samba.org/samba/docs/usi...CHP-9-SECT-4.3 for details.

I believe PAM has some features that might also help with synchronizing passwords, but don't personally have any experience with that.

Using an LDAP server for authentication for both the Unix and Samba users would also solve the problem. The best way to go about this depends on your specific setup, though.

Good luck!
 
1 members found this post helpful.
Old 06-22-2013, 08:43 AM   #3
gacanepa
Member
 
Registered: May 2012
Location: San Luis, Argentina
Distribution: Debian
Posts: 205

Original Poster
Rep: Reputation: 27
Quote:
Originally Posted by cliffordw View Post
Hi there,

I assume your Unix passwords are locally stored passwords in /etc/shadow or a similar file for your distro, and not in an external directory of some sort (LDAP/AD/etc). If so, what you're proposing is unfortunately not possible afaik. The reason for this is that the Unix passwords are encrypted with a one way hash (DES/MD5/SHA1/etc), and can't be decrypted to produce the plain text version fo the password again. The password in the smbpasswd file is encrypted using a different algorithm, so to create this from /etc/shadow would require the plain text password.

One alternative that might help to some degree is the Samba "unix password sync" option, which attempts to change the Unix password whenever you change the Samba password. See https://www.samba.org/samba/docs/usi...CHP-9-SECT-4.3 for details.

I believe PAM has some features that might also help with synchronizing passwords, but don't personally have any experience with that.

Using an LDAP server for authentication for both the Unix and Samba users would also solve the problem. The best way to go about this depends on your specific setup, though.

Good luck!
Thank you very much! I will look into this.
I will mark this as solved and add to your rep.
 
  


Reply


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
LXer: Debian Wheezy Samba Standalone Server With tdbsam Backend LXer Syndicated Linux News 0 06-04-2013 12:40 PM
Cannot access win 7 shares from debian wheezy with samba? shams Linux - Newbie 2 09-03-2012 12:50 PM
[SOLVED] Where is samba password file - need to list samba users explorer Slackware 8 04-06-2011 05:26 PM
SAMBA - unix user created, added to samba, and valid users on share, still cannot... mitchell7man Linux - Server 12 03-17-2010 08:37 PM
Just change Samba password, not Unix password? sorrodos Linux - Networking 1 08-14-2003 07:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration