banner

[Rule] Rules  [Home] Main Forum  [Portal] Portal  
[Members] Member Listing  [Statistics] Statistics  [Search] Search  [Reading Room] Reading Room 
[Register] Register  
[Login] Loginhttp  | https  ]
 
Forum Index Thảo luận hệ điều hành *nix Samba: ERROR: failed to setup guest info.  XML
  [Question]   Samba: ERROR: failed to setup guest info. 11/05/2012 15:27:39 (+0700) | #1 | 262975
[Avatar]
vitcon01
Member

[Minus]    0    [Plus]
Joined: 29/04/2009 11:28:21
Messages: 306
Offline
[Profile] [PM]
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
[Up] [Print Copy]
  [Question]   ERROR: failed to setup guest info. 11/05/2012 15:36:00 (+0700) | #2 | 262976
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]

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!
[Up] [Print Copy]
  [Question]   Samba: ERROR: failed to setup guest info. 11/05/2012 15:41:37 (+0700) | #3 | 262977
[Avatar]
vitcon01
Member

[Minus]    0    [Plus]
Joined: 29/04/2009 11:28:21
Messages: 306
Offline
[Profile] [PM]
- 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
[Up] [Print Copy]
  [Question]   Samba: ERROR: failed to setup guest info. 11/05/2012 15:51:25 (+0700) | #4 | 262978
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]
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!
[Up] [Print Copy]
  [Question]   Samba: ERROR: failed to setup guest info. 11/05/2012 15:54:32 (+0700) | #5 | 262979
[Avatar]
vitcon01
Member

[Minus]    0    [Plus]
Joined: 29/04/2009 11:28:21
Messages: 306
Offline
[Profile] [PM]
-EM đã comment dòng guest account để nó default
-Nó không lắng nghe port nào hết anh

JK - JH
()()()
LTKT - LTT
[Up] [Print Copy]
  [Question]   Samba: ERROR: failed to setup guest info. 11/05/2012 16:09:57 (+0700) | #6 | 262980
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]

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!
[Up] [Print Copy]
  [Question]   Samba: ERROR: failed to setup guest info. 11/05/2012 16:11:49 (+0700) | #7 | 262981
[Avatar]
vitcon01
Member

[Minus]    0    [Plus]
Joined: 29/04/2009 11:28:21
Messages: 306
Offline
[Profile] [PM]
-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
[Up] [Print Copy]
  [Question]   Samba: ERROR: failed to setup guest info. 12/05/2012 07:50:45 (+0700) | #8 | 263014
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]
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!
[Up] [Print Copy]
  [Question]   Samba: ERROR: failed to setup guest info. 12/05/2012 10:45:29 (+0700) | #9 | 263026
[Avatar]
vitcon01
Member

[Minus]    0    [Plus]
Joined: 29/04/2009 11:28:21
Messages: 306
Offline
[Profile] [PM]
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
[Up] [Print Copy]
  [Question]   Samba: ERROR: failed to setup guest info. 12/05/2012 10:54:19 (+0700) | #10 | 263027
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]
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!
[Up] [Print Copy]
  [Question]   Samba: ERROR: failed to setup guest info. 12/05/2012 10:57:22 (+0700) | #11 | 263028
[Avatar]
vitcon01
Member

[Minus]    0    [Plus]
Joined: 29/04/2009 11:28:21
Messages: 306
Offline
[Profile] [PM]
Vâng, nó báo như vậy có nghĩa là đã tồn tại, tuy nhiên khi em pdbedit -Lv nobody thì lại không có, để chắn ăn em dùng lệnh pdbedit -x nobody tuy nhiên nó báo cũng ko tìm thấy user này.
JK - JH
()()()
LTKT - LTT
[Up] [Print Copy]
  [Question]   Samba: ERROR: failed to setup guest info. 12/05/2012 11:01:31 (+0700) | #12 | 263029
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]

vitcon01 wrote:
Vâng, nó báo như vậy có nghĩa là đã tồn tại, tuy nhiên khi em pdbedit -Lv nobody thì lại không có, để chắn ăn em dùng lệnh pdbedit -x nobody tuy nhiên nó báo cũng ko tìm thấy user này. 

Không phải.
(Object class violation) (object class 'sambaSamAccount' requires attribute 'sambaSID') 
Let's build on a great foundation!
[Up] [Print Copy]
  [Question]   Samba: ERROR: failed to setup guest info. 12/05/2012 11:02:46 (+0700) | #13 | 263030
[Avatar]
vitcon01
Member

[Minus]    0    [Plus]
Joined: 29/04/2009 11:28:21
Messages: 306
Offline
[Profile] [PM]
Vâng vấn đề đó em cũng đã thêm cho nó thông qua phpldapadmin
JK - JH
()()()
LTKT - LTT
[Up] [Print Copy]
  [Question]   Samba: ERROR: failed to setup guest info. 12/05/2012 16:20:37 (+0700) | #14 | 263042
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]

vitcon01 wrote:
Vâng vấn đề đó em cũng đã thêm cho nó thông qua phpldapadmin 

Vậy giờ đã add được nobody vào chưa?
Let's build on a great foundation!
[Up] [Print Copy]
  [Question]   Samba: ERROR: failed to setup guest info. 13/05/2012 11:11:46 (+0700) | #15 | 263072
[Avatar]
vitcon01
Member

[Minus]    0    [Plus]
Joined: 29/04/2009 11:28:21
Messages: 306
Offline
[Profile] [PM]

quanta wrote:

vitcon01 wrote:
Vâng vấn đề đó em cũng đã thêm cho nó thông qua phpldapadmin 

Vậy giờ đã add được nobody vào chưa? 

Vâng khi sử dụng lệnh pdbedit -Lv nobody thì đã có thông tin người dùng nhưng kết quả vẫn như tiêu đề anh à.
JK - JH
()()()
LTKT - LTT
[Up] [Print Copy]
  [Question]   Samba: ERROR: failed to setup guest info. 13/05/2012 12:20:04 (+0700) | #16 | 263076
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]
Em gửi output `pdbedit -Lv nobody` và đoạn log phía trên "ERROR: failed to setup guest info" lên nhé.
Let's build on a great foundation!
[Up] [Print Copy]
[digg] [delicious] [google] [yahoo] [technorati] [reddit] [stumbleupon]
Go to: 
 Users currently in here 
1 Anonymous

Powered by JForum - Extended by HVAOnline
 hvaonline.net  |  hvaforum.net  |  hvazone.net  |  hvanews.net  |  vnhacker.org
1999 - 2013 © v2012|0504|218|