為什麼使用
cat /etc/passwd | mksmbpasswd > /etc/samba.d/smbpasswd
新建的帳戶還是無法從win98 的 client 端進入,非得要用 smbpasswd -a user1 ,有無其他的辦法可以一次建多量的帳號.
版主: 阿信
kahn 寫:samba 3.0.2a-1
libpam-smbpass 有裝
/etc/pam.d/passwd 如下
password required pam_unix.so nullok obscure min=4 max=8 md5
password sufficient pam_smbpass.so audit use_first_pass
前題是只要沒smbpasswd -a user1 的使用者都無法使用
/var/lib/samba/secrets.tdb
/var/lib/samba/account_policy.tdb
/var/lib/samba/passdb.tdb
umask 066
getent passwd | /usr/sbin/mksmbpasswd > /etc/samba/smbpasswd
pdbedit -i smbpasswd -e tdbsam
rm /etc/samba/smbpasswd
umask 022
dpkg-reconfigure samba
grep "tetralet" /etc/samba/smbpasswd
tetralet:1000:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:[DU ]:LCT-00000000:
# passwd tetralet
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
# rm /etc/samba/smbpasswd
rm: remove regular file `/etc/samba/smbpasswd'? y
# pdbedit -e smbpasswd -i tdbsam
startsmbfilepwent_internal: file /etc/samba/smbpasswd did not exist. File successfully created.
# grep "tetralet" /etc/samba/smbpasswd
tetralet:1000:BX7X7X7X2XFXAXAXDX3XBX4X3X5XAXCX:7XEX1X1XCXAXEXEX7X5X3X2XD0546AD6:[DU ]:LCT-40A1ADB3:
Tetralet 寫:檢查一下,Samba 的密碼是否同步更新了:
- 代碼: 選擇全部
# rm /etc/samba/smbpasswd
rm: remove regular file `/etc/samba/smbpasswd'? y
# pdbedit -e smbpasswd -i tdbsam
startsmbfilepwent_internal: file /etc/samba/smbpasswd did not exist. File successfully created.
# grep "tetralet" /etc/samba/smbpasswd
tetralet:1000:BX7X7X7X2XFXAXAXDX3XBX4X3X5XAXCX:7XEX1X1XCXAXEXEX7X5X3X2XD0546AD6:[DU ]:LCT-40A1ADB3:
看!已成功變更囉~
請您再試試看,
有任何問題歡迎您再提出來,
我們一起討論吧!
阿信 寫:下午弄了一下,由於我沒有採用 smbpasswd,設定好 Tetralet 兄所說得 /etc/pam.d/passwd 之後,只是 dpkg-reconfigure samba。
阿信 寫:然後 passwd user1 的密碼之後,windows 端就能用 user1 新密碼登入 Samba Server....
# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
unix password sync = yes
Tetralet 寫:請別忘了在 /etc/samba/smb.conf 加上:
- 代碼: 選擇全部
# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
unix password sync = yes
這樣子,
就可以確保 Windows Client 和 Linux 的密碼能夠完全同步了!
kahn 寫:/etc/pam.d/passwd 加了最後兩行
@include common-password
password required pam_unix.so nullok obscure min=4 max=8 md5
password sufficient pam_smbpass.so audit use_first_pass
正在瀏覽這個版面的使用者:沒有註冊會員 和 1 位訪客