[Question] Samba: ERROR: failed to setup guest info. |
11/05/2012 15:27:39 (+0700) | #1 | 262975 |
|
vitcon01
Member
|
0 |
|
|
Joined: 29/04/2009 11:28:21
Messages: 306
Offline
|
|
Em đang muốn config Samba+LDAP như một PDC.
-OS:Centos 5.5
-Openldap:
Code:
+openldap-2.3.43-12.el5
+openldap-devel-2.3.43-12.el5
+openldap-servers-2.3.43-12.el5
+openldap-clients-2.3.43-12.el5
-Sampa
Code:
+samba-3.0.33-3.28.el5
+samba-common-3.0.33-3.28.el5
+samba-client-3.0.33-3.28.el5
-File slapd.conf
Code:
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/nis.schema
include /etc/openldap/schema/samba.schema
allow bind_v2
pidfile /var/run/openldap/slapd.pid
argsfile /var/run/openldap/slapd.args
logfile /var/log/openldap
loglevel -1
database bdb
suffix "dc=langla,dc=net"
rootdn "cn=admin,dc=langla,dc=net"
rootpw {SSHA}87Bdd4ic1Rjr5543Tll16wYUXN/YXdlY
directory /var/lib/ldap
index sambaSID,sambaPrimaryGroupSID,sambaDomainName eq
index default sub
index objectClass eq,pres
index ou,cn,mail,surname,givenname eq,pres,sub
index uidNumber,gidNumber,loginShell eq,pres
index uid,memberUid eq,pres,sub
index nisMapName,nisMapEntry eq,pres,sub
access to attrs=userPassword,sambaLMPassword,sambaNTPassword
by self write
by anonymous auth
by * none
access to *
by * read
-File smb.conf
Code:
[global]
workgroup = langla.net
server string = Samba Server Version %v
netbios name = MYSERVER
enable privileges = yes
encrypt passwords = Yes
log level= 9
guest account = root
# logs split per machine
# max 50KB per log file, then rotate
security = user
local master = yes
preferred master = yes
passdb backend = ldapsam:ldap://localhost
ldap suffix = dc=langla,dc=net
ldap user suffix = ou=People
ldap group suffix = ou=Groups
ldap machine suffix = ou=Hosts
ldap idmap suffix = ou=Idmap
ldap admin dn = cn=admin,dc=langla,dc=net
domain master = yes
domain logons = yes
# the login script name depends on the machine name
logon script = %m.bat
# the login script name depends on the unix user used
logon script = %u.bat
logon path = \\%L\Profiles\%u
# disables profiles support by specifing an empty path
wins support = yes
[homes]
comment = Home Directories
browseable = no
writable = yes
[netlogon]
comment = Network Logon Service
path = /var/lib/samba/netlogon
guest ok = yes
writable = no
share modes = no
[Profiles]
path = /var/lib/samba/profiles
browseable = no
guest ok = yes
-Vấn đề là khi em tiến hành restart smbd thì stop nó bị fail và kiểm tra PID thì nó báo
Code:
smbd dead but pid file exists
-Xem log samba thì nó báo
Code:
ERROR: failed to setup guest info.
ANh chị nào từng gặp trường hợp này xin hướng dẫn giúp. |
|
JK - JH
()()()
LTKT - LTT |
|
|
|
[Question] ERROR: failed to setup guest info. |
11/05/2012 15:36:00 (+0700) | #2 | 262976 |
|
quanta
Moderator
|
Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
|
|
vitcon01 wrote:
Code:
smbd dead but pid file exists
Xoá nốt pid file đi rồi thử lại.
vitcon01 wrote:
-Xem log samba thì nó báo
Code:
ERROR: failed to setup guest info.
# pdbedit -Lv nobody? |
|
Let's build on a great foundation! |
|
|
|
[Question] Samba: ERROR: failed to setup guest info. |
11/05/2012 15:41:37 (+0700) | #3 | 262977 |
|
vitcon01
Member
|
0 |
|
|
Joined: 29/04/2009 11:28:21
Messages: 306
Offline
|
|
- EM cũng đã thử lệnh này pdbedit -x nobody và thông điệp phía dưới:
Code:
Attempting to find an passdb backend to match ldapsam:ldap://localhost (ldapsam)
Found pdb backend ldapsam
smbldap_search_domain_info: Searching for:[(&(objectClass=sambaDomain)(sambaDomainName=LANGLA.NET))]
smbldap_search_ext: base => [dc=langla,dc=net], filter => [(&(objectClass=sambaDomain)(sambaDomainName=LANGLA.NET))], scope => [2]
The connection to the LDAP server was closed
smbldap_open_connection: connection opened
ldap_connect_system: successful connection to the LDAP server
The LDAP server is successfully connected
pdb backend ldapsam:ldap://localhost has a valid init
Netbios name list:-
my_netbios_names[0]="MYSERVER"
Attempting to find an passdb backend to match ldapsam:ldap://localhost (ldapsam)
Found pdb backend ldapsam
smbldap_search_domain_info: Searching for:[(&(objectClass=sambaDomain)(sambaDomainName=LANGLA.NET))]
smbldap_search_ext: base => [dc=langla,dc=net], filter => [(&(objectClass=sambaDomain)(sambaDomainName=LANGLA.NET))], scope => [2]
The connection to the LDAP server was closed
smbldap_open_connection: connection opened
ldap_connect_system: successful connection to the LDAP server
The LDAP server is successfully connected
pdb backend ldapsam:ldap://localhost has a valid init
smbldap_search_ext: base => [dc=langla,dc=net], filter => [(&(uid=nobody)(objectclass=sambaSamAccount))], scope => [2]
ldapsam_getsampwnam: Unable to locate user [nobody] count=0
user nobody does not exist in the passdb
--->tuy nhiên em sử dụng phpldapadmin để kiểm tra thì nó tồn tại group nobody và user nobody, đây là nội dung file ldif của em:
Code:
dn: cn=nobody,ou=Group,dc=langla,dc=net
objectClass: posixGroup
objectClass: top
cn: nobody
userPassword: {crypt}x
gidNumber: 99
dn: uid=nobody,ou=People,dc=langla,dc=net
uid: nobody
cn: Nobody
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
userPassword: {crypt}*
shadowLastChange: 15469
shadowMax: 99999
shadowWarning: 7
loginShell: /sbin/nologin
uidNumber: 99
gidNumber: 99
homeDirectory: /
gecos: Nobody
-EM đã cóa, nhưng vấn đề ở chỗ dù nó ok nhưng nó cũng không open port 139, 445. |
|
JK - JH
()()()
LTKT - LTT |
|
|
|
[Question] Samba: ERROR: failed to setup guest info. |
11/05/2012 15:51:25 (+0700) | #4 | 262978 |
|
quanta
Moderator
|
Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
|
|
Xem lại dòng "guest account" trong smb.conf.
vitcon01 wrote:
-EM đã xóa, nhưng vấn đề ở chỗ dù nó ok nhưng nó cũng không open port 139, 445.
Vậy nó listen port bao nhiêu? |
|
Let's build on a great foundation! |
|
|
|
[Question] Samba: ERROR: failed to setup guest info. |
11/05/2012 15:54:32 (+0700) | #5 | 262979 |
|
vitcon01
Member
|
0 |
|
|
Joined: 29/04/2009 11:28:21
Messages: 306
Offline
|
|
-EM đã comment dòng guest account để nó default
-Nó không lắng nghe port nào hết anh
|
|
JK - JH
()()()
LTKT - LTT |
|
|
|
[Question] Samba: ERROR: failed to setup guest info. |
11/05/2012 16:09:57 (+0700) | #6 | 262980 |
|
quanta
Moderator
|
Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
|
|
vitcon01 wrote:
-EM đã comment dòng guest account để nó default
"default" là như nào?
vitcon01 wrote:
-Nó không lắng nghe port nào hết anh
Chứng tỏ chưa start được. |
|
Let's build on a great foundation! |
|
|
|
[Question] Samba: ERROR: failed to setup guest info. |
11/05/2012 16:11:49 (+0700) | #7 | 262981 |
|
vitcon01
Member
|
0 |
|
|
Joined: 29/04/2009 11:28:21
Messages: 306
Offline
|
|
-Default nó sử dụng người dùng nobody
-Vân chính xác là nó chưa start được |
|
JK - JH
()()()
LTKT - LTT |
|
|
|
[Question] Samba: ERROR: failed to setup guest info. |
12/05/2012 07:50:45 (+0700) | #8 | 263014 |
|
quanta
Moderator
|
Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
|
|
Xem lại đoạn này:
vitcon01 wrote:
- EM cũng đã thử lệnh này pdbedit -x nobody và thông điệp phía dưới:
Code:
smbldap_search_ext: base => [dc=langla,dc=net], filter => [(&(uid=nobody)(objectclass=sambaSamAccount))], scope => [2]
ldapsam_getsampwnam: Unable to locate user [nobody] count=0
user nobody does not exist in the passdb
và:
--->tuy nhiên em sử dụng phpldapadmin để kiểm tra thì nó tồn tại group nobody và user nobody, đây là nội dung file ldif của em:
Code:
...
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
Sau đó đọc `man pdbedit` hoặc cái này: http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/passdb.html |
|
Let's build on a great foundation! |
|
|
|
[Question] Samba: ERROR: failed to setup guest info. |
12/05/2012 10:45:29 (+0700) | #9 | 263026 |
|
vitcon01
Member
|
0 |
|
|
Joined: 29/04/2009 11:28:21
Messages: 306
Offline
|
|
Vâng, em đã đọc qua tdbsam dành chon những hệ thống nhỏ(dưới 250 người dùng) còn ldapsam danh cho nhữn hệ thống lớn và phức tạp.
Em dùng pdbedit -a nobody để thêm người dùng tuy nhiên nó báo :
Code:
smbldap_search_ext: base => [dc=langla,dc=net], filter => [(uid=nobody)], scope => [2]
ldapsam_add_sam_account: User exists without samba attributes: adding them
smbldap_make_mod: attribute |uid| not changed.
init_ldap_from_sam: Setting entry for user: nobody
smbldap_get_single_attribute: [displayName] = [<does not exist>]
smbldap_make_mod: adding attribute |displayName| value |Nobody|
Returning valid cache entry: key = ACCT_POL/maximum password age, value = 4294967295
, timeout = Thu May 10 20:13:32 2012
smbldap_get_single_attribute: [sambaLMPassword] = [<does not exist>]
smbldap_make_mod: adding attribute |sambaLMPassword| value |AAD3B435B51404EEAAD3B435B51404EE|
smbldap_get_single_attribute: [sambaNTPassword] = [<does not exist>]
smbldap_make_mod: adding attribute |sambaNTPassword| value |31D6CFE0D16AE931B73C59D7E0C089C0|
Returning valid cache entry: key = ACCT_POL/password history, value = 0
, timeout = Thu May 10 20:14:12 2012
smbldap_get_single_attribute: [sambaPasswordHistory] = [<does not exist>]
smbldap_make_mod: adding attribute |sambaPasswordHistory| value |0000000000000000000000000000000000000000000000000000000000000000|
smbldap_get_single_attribute: [sambaPwdLastSet] = [<does not exist>]
smbldap_make_mod: adding attribute |sambaPwdLastSet| value |1336655596|
smbldap_get_single_attribute: [sambaAcctFlags] = [<does not exist>]
smbldap_make_mod: adding attribute |sambaAcctFlags| value |[U ]|
smbldap_modify: dn => [uid=nobody,ou=People,dc=langla,dc=net]
Failed to modify dn: uid=nobody,ou=People,dc=langla,dc=net, error: 65 (Object class violation) (object class 'sambaSamAccount' requires attribute 'sambaSID')
ldapsam_add_sam_account: failed to modify/add user with uid = nobody (dn = uid=nobody,ou=People,dc=langla,dc=net)
Unable to add user! (does it already exist?)
Khi đó em dùng phpldapadmin để thêm thuộc tính sambaaccount cho nó, sau đó thực hiện lệnh pdbedit -Lv nobody thì nó thông báo như sau:
Code:
Unix username: nobody
NT username: nobody
Account Flags: [U ]
User SID: S-1-5-21-2826943894-2740492331-631777304-501
Finding user nobody
Trying _Get_Pwnam(), username as lowercase is nobody
Get_Pwnam_internals did find user [nobody]!
smbldap_search_ext: base => [ou=Groups,dc=langla,dc=net], filter => [(&(objectClass=sambaGroupMapping)(gidNumber=99))], scope => [2]
Failed search for base: ou=Groups,dc=langla,dc=net, error: 32 (No such object) ()
Primary Group SID: S-1-5-21-2826943894-2740492331-631777304-513
Full Name: Nobody
Home Directory: \\myserver\nobody
HomeDir Drive:
Logon Script: %u.bat
Profile Path: \\myserver\Profiles\%u
Domain: LANGLA.NET
Account desc:
Workstations:
Munged dial:
Logon time: 0
Logoff time: never
Kickoff time: never
Password last set: 0
Password can change: 0
Password must change: 0
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
Sau đó em restart smb thì tình trạng như cũ, vẫn không thấy mở port 139 hay 445(chưua start). |
|
JK - JH
()()()
LTKT - LTT |
|
|
|
[Question] Samba: ERROR: failed to setup guest info. |
12/05/2012 10:54:19 (+0700) | #10 | 263027 |
|
quanta
Moderator
|
Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
|
|
Lỗi đã báo rất rõ:
vitcon01 wrote:
Em dùng pdbedit -a nobody để thêm người dùng tuy nhiên nó báo :
Code:
Failed to modify dn: uid=nobody,ou=People,dc=langla,dc=net, error: 65 \
(Object class violation) (object class 'sambaSamAccount' requires attribute 'sambaSID')
ldapsam_add_sam_account: failed to modify/add user with uid = nobody (dn = uid=nobody,ou=People,dc=langla,dc=net)
Unable to add user! (does it already exist?)
|
|
Let's build on a great foundation! |
|
|