个人工具

“UbuntuHelp:AlternativeActiveDirectory/zh”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(定制活动目录)
 
 
(未显示2个用户的9个中间版本)
第1行: 第1行:
{{Translation}}<br> {{From|http://wiki.ubuntu.org.cn/UbuntuHelp:AlternativeActiveDirectory}}<br> {{Translator|isbasic}}<br> {{Languages|定制活动目录}}
+
{{Translation}}<br> {{From|http://wiki.ubuntu.org.cn/UbuntuHelp:AlternativeActiveDirectory}}<br> {{Translator|isbasic}}<br> {{Languages|UbuntuHelp:AlternativeActiveDirectory}}
  
Active Directory from Microsoft is a directory service that uses some open protocols, like Kerberos, LDAP and SSL. There are several ways to use AD for authentication, and with LDAP tools you can extend a local authentication scheme to "cache" your Active Directory credentials.
+
微软推出的活动目录是一种采用开放式协议的目录服务,类似Kerberos,LDAP和SSL。有几种方法采用AD(Active Directory)进行认证,结合LDAP的工具,你可以扩展本地的认证计划,以"快取"您的Active Directory证书。 <br>
 
+
微软推出的活动目录是一种采用开放式协议的目录服务,类似Kerberos,LDAP和SSL。有几种方法采用AD(Active Directory)进行认证,结合LDAP的工具,你可以扩展本地的认证计划,以"快取"您的Active Directory证书。
+
  
 
<br>
 
<br>
  
== LDAP Caching: ==
+
== ''LDAP快速设置'' ==
  
''LDAP 高速缓存''
+
=== '''配置和安装''' ===
  
=== Configuration and Installation ===
+
<br>
  
'''配置与安装'''
+
安装一个LDAP的缓存系统,你需要从源代码编译libpam-script并且安装ldap-utils.注:你不需要在Active Directory中为LDAP的缓存做任何配置。我这预先编译好了一个libpam -script文件(https://help.ubuntu.com/community/AlternativeActiveDirectory?action=AttachFile&amp;do=get&amp;target=libpam-script_0.1.11-1_i386.deb%29) 在Feisty上,任何人不用担心自己不会编译软件。deb文件会在编译时添加默认的选项且deb文件会自动生成checkinstall 。
  
To install a LDAP caching system you need to compile libpam-script from source and install ldap-utils. Note: you don't have to configure anything in Active Directory for LDAP caching. I have a premade deb for installing libpam-script (https://help.ubuntu.com/community/AlternativeActiveDirectory?action=AttachFile&amp;do=get&amp;target=libpam-script_0.1.11-1_i386.deb%29) on a Feisty system for anyone not interested in compiling their own. It was compiled with default options and a deb file automatically generated with checkinstall. Then you need to set up /etc/pam.d/common-auth as follows:
 
 
安装一个LDAP的缓存系统,你需要汇编位于libpam -脚本从源代码和安装的LDAP utils调整.注:您不需要有任何配置在Active Directory中为LDAP的缓存。我有一个premade deb的安装位于libpam -脚本的(https://help.ubuntu.com/community/AlternativeActiveDirectory?action=AttachFile&amp;do=get&amp;target=libpam-script_0.1.11-1_i386.deb%29) 日去战斗系统,任何人不有兴趣在编制自己的。它在编译时默认的选项和deb文件自动生成与checkinstall 。那么你需要设置/ etc / pam.d /通用认证如下:
 
<div>auth required pam_script.so runas=root expose=1 auth required pam_unix.so nullok_secure use_first_pass</div>
 
 
<br>
 
<br>
  
set up /etc/security/onauth:
+
那么你需要按照如下方法设置 / etc / pam.d /common-auth:
 
+
<div></div>  
编辑 /etc/security/onauth:
+
auth required pam_script.so runas=root expose=1
 
+
auth required pam_unix.so nullok_secure use_first_pass
[[ #!/bin/bash<br>userid=$1<br>service=$2<br># $3 is supposed to contain $PAM_AUTHTOK, but this guarantees the correct token is used<br>authtok=$PAM_AUTHTOK<br>ldapsearch -h &lt;serverip&gt; -p &lt;port&gt; -D"$1@your.domain.here" -x -w$authtok -b "dc=your,dc=domain,dc=here" "(samaccountname=$1)" samaccountname | grep -v filter | grep -i $1 | cut -f2 -d' ' &gt; /tmp/ldap<br>if [ "`cat /tmp/ldap`" == "$1" ]; then<br> usermod -p `mkpasswd $authtok` $1;<br>fi<br>exit 0]]
+
 +
 +
  
 +
<br> <br> 编辑 /etc/security/onauth:
 +
<div><br></div>
 
<br>
 
<br>
  
<br>
+
# /bin/bash
 +
userid=$1
 +
service=$2
 +
# $3 is supposed to contain $PAM_AUTHTOK, but this guarantees the correct token is used
 +
authtok=$PAM_AUTHTOK
 +
ldapsearch -h &lt;serverip&gt; -p &lt;port&gt; -D"[email protected]" -x -w$authtok -b "dc=your,dc=domain,dc=here" "(samaccountname=$1)" samaccountname | grep -v filter | grep -i $1 | cut -f2 -d' ' &gt; /tmp/ldap
 +
if [ "`cat /tmp/ldap`" == "$1" ]; then
 +
usermod -p `mkpasswd $authtok` $1;
 +
fi
 +
exit 0
 +
 +
 +
  
This script sets the local password for any domain account to whatever the domain password is. Make sure this is what you want, because any local accounts will have their password changed after a successful login to the domain. Password changing must be done through other means; the Active Directory is the final authority on passwords with this mechanism, and it is one way.
+
<br> <br>
  
<br>这个剧本集本地密码的任何域帐户,无论域密码。作出肯定这是你想要做的,因为任何地方的帐户将有自己的密码改成功後,登录到域。密码不断变化的,必须通过其他手段; Active Directory是最後权威的密码实行这种机制,这是其中一个方法。
+
这个脚本设定了所有域成员的本地域密码。请确定这是你想要做的,因为任何帐户登录域成功後密码都会改变。而要再次改变密码,只能通过其他的方法; “活动目录”是其中一个比较权威的解决办法。
  
== Local Accounts ==
+
<br>
  
''本地帐户''
+
== ''本地帐户'' ==
  
=== Configure Accounts ===
+
=== '''配置帐户''' ===
  
'''配置帐户'''
+
&nbsp;Local accounts are necessary before any users can login to the system. This can be done either through a local passwd file or by setting up LDAP for the Linux users. Either way, extraction of the account names from Active Directory has to be done to synchronize the accounts before use. The following script illustrates one way to make the users: <br>
 
+
Local accounts are necessary before any users can login to the system. This can be done either through a local passwd file or by setting up LDAP for the Linux users. Either way, extraction of the account names from Active Directory has to be done to synchronize the accounts before use. The following script illustrates one way to make the users:
+
 
+
<br>本地户口之前,还需要任何用户可以登录到该系统。这是可以做到的要么通过本地密码文件或者设立的LDAP为Linux用户。无论哪种方式,提取帐户名称由主动目录必须做同步帐户,然後才能使用。请看下面的代码说明了一个方法,使用户:
+
 
+
[[#!/bin/bash<br># usage: makeuser &lt;domain&gt; &lt;username&gt; [details]<br>useradd $2 -c"$3 $4 $5 $6" -d/home/$1/$2 -m]]
+
  
 +
在加入活动目录之前必须有一个本地帐户用来登录到本地系统。通过修改本地密码文件或者设立的LDAP中的Linux用户可以做到这一点。无论那种方法都必须在活动目录将本地帐户与域帐户同步之後才可以使用。下面的脚本范例就是其中一种创建域用户的办法:
 +
<div></div>
 +
#!/bin/bash
 +
# usage: makeuser &lt;domain&gt; &lt;username&gt; [details]
 +
useradd $2 -c"$3 $4 $5 $6" -d/home/$1/$2 -m
 +
<div></div>
 +
这个脚本可以从一个文件中递归一个用户名清单以供调用:
 +
<div></div>
 
<br>
 
<br>
  
This script can be called recursively with a list of usernames from a file by using:
+
cat userlist | while read line; do sudo ./makeuser mydomain ${line}; done  
 
+
此脚本可被称为递归一份清单的用户从一个文件用:
+
 
+
[[Cat userlist|while read line; do sudo ./makeuser mydomain ${line}; done]]
+
 
+
<br>The userlist file should be formatted similar to the following:
+
 
+
<br>该userlist档案中要格式化类似如下的问题:
+
 
+
<br>[[firstuser User, First<br>seconduser User, Second 2nd<br>thirduser User, 3rd Third details]]
+
  
<br>By calling the makeuser script with a domain component, it is easier to search which domain the user was created from at authentication time; thus this method supports multiple domains (for example using a simple getent passwd &lt;user&gt;, and grepping/cutting the results), as long as each domain contains a unique set of users. To create the userlist file, I used a bit of LDAP querying and manipulating the results. You can use any means you wish to get the list. Once accounts are created, you should have an automated way to recreate this list and reimport the usernames on a regular basis to ensure any new accounts created on the Active Directory are also reflected in your local cache. Inquiries: MailTo(clay DOT berlo AT gmail DOT com)
+
<br> userlist档案中的内容要用如下格式填写: <br>
  
<br>致电makeuser脚本与领域构件,它是比较容易搜索,其中域用户创建,从在认证时间,因此这种方法支持多种域名(如:用一个简单的getent在 passwd &lt;user&gt; , grepping /切割结果),只要每一个域包含了一套独特的用户。创造userlist文件,我用有点LDAP的查询和操纵的结果。你可以使用任何手段,你想获得这份名单。一旦账户创造了,你应该有一个自动化的方法可以给这份名单,并reimport用户名就定期举行,以确保任何新设立的账户上的Active Directory也反映在你的本地高速缓存。咨询电话:发邮件至(粘土斑点berlo在Gmail的斑点组件)
+
firstuser User, First seconduser User, Second 2nd thirduser User, 3rd Third details
 +
<div><div></div> <br>通过构建域的makeuser脚本,可以快速的从创建认证时间来搜索用户,因此这种方法支持多种域名(如:用一个简单的getent在 passwd &lt;user&gt; , grepping /切割结果),只要每一个域用户都具有唯一性。创造userlist文件後,我们用LDAP来手动查询结果。你也可以使用任何方法来获得这份名单。一旦账户创造了,你应该有一个自动化的方法来定期维护用户名单,以确保任何在活动目录(Active Directory)上新设立的账户可以同步缓存到本地。MailTo:(clayDOTberloATgmailDOTcom)</div>

2008年3月13日 (四) 11:04的最新版本





微软推出的活动目录是一种采用开放式协议的目录服务,类似Kerberos,LDAP和SSL。有几种方法采用AD(Active Directory)进行认证,结合LDAP的工具,你可以扩展本地的认证计划,以"快取"您的Active Directory证书。


LDAP快速设置

配置和安装


安装一个LDAP的缓存系统,你需要从源代码编译libpam-script并且安装ldap-utils.注:你不需要在Active Directory中为LDAP的缓存做任何配置。我这预先编译好了一个libpam -script文件(https://help.ubuntu.com/community/AlternativeActiveDirectory?action=AttachFile&do=get&target=libpam-script_0.1.11-1_i386.deb%29) 在Feisty上,任何人不用担心自己不会编译软件。deb文件会在编译时添加默认的选项且deb文件会自动生成checkinstall 。


那么你需要按照如下方法设置 / etc / pam.d /common-auth:

auth required pam_script.so runas=root expose=1
auth required pam_unix.so nullok_secure use_first_pass





编辑 /etc/security/onauth:



# /bin/bash
userid=$1
service=$2
# $3 is supposed to contain $PAM_AUTHTOK, but this guarantees the correct token is used
authtok=$PAM_AUTHTOK
ldapsearch -h <serverip> -p <port> -D"[email protected]" -x -w$authtok -b "dc=your,dc=domain,dc=here" "(samaccountname=$1)" samaccountname | grep -v filter | grep -i $1 | cut -f2 -d' ' > /tmp/ldap
if [ "`cat /tmp/ldap`" == "$1" ]; then
usermod -p `mkpasswd $authtok` $1;
fi
exit 0





这个脚本设定了所有域成员的本地域密码。请确定这是你想要做的,因为任何帐户登录域成功後密码都会改变。而要再次改变密码,只能通过其他的方法; “活动目录”是其中一个比较权威的解决办法。


本地帐户

配置帐户

 Local accounts are necessary before any users can login to the system. This can be done either through a local passwd file or by setting up LDAP for the Linux users. Either way, extraction of the account names from Active Directory has to be done to synchronize the accounts before use. The following script illustrates one way to make the users:

在加入活动目录之前必须有一个本地帐户用来登录到本地系统。通过修改本地密码文件或者设立的LDAP中的Linux用户可以做到这一点。无论那种方法都必须在活动目录将本地帐户与域帐户同步之後才可以使用。下面的脚本范例就是其中一种创建域用户的办法:

#!/bin/bash
# usage: makeuser <domain> <username> [details]
useradd $2 -c"$3 $4 $5 $6" -d/home/$1/$2 -m

这个脚本可以从一个文件中递归一个用户名清单以供调用:


cat userlist | while read line; do sudo ./makeuser mydomain ${line}; done 




userlist档案中的内容要用如下格式填写:

firstuser User, First seconduser User, Second 2nd thirduser User, 3rd Third details

通过构建域的makeuser脚本,可以快速的从创建认证时间来搜索用户,因此这种方法支持多种域名(如:用一个简单的getent在 passwd <user> , grepping /切割结果),只要每一个域用户都具有唯一性。创造userlist文件後,我们用LDAP来手动查询结果。你也可以使用任何方法来获得这份名单。一旦账户创造了,你应该有一个自动化的方法来定期维护用户名单,以确保任何在活动目录(Active Directory)上新设立的账户可以同步缓存到本地。MailTo:(clayDOTberloATgmailDOTcom)