查看远程用户ssh登录信息:
grep sshd /var/log/auth.log
pam的描述:
[url]http://www.ubuntuchina.com/viewthread.php?tid=5630[/url]
准备工作:
1.安装openldap
2.安装openssh
需要配置的文件:
/etc/nsswitch.conf 和/etc/pam.d
这是我的配置:/etc/nssitch
参考:[url]http://ubuntuforums.org/showthread.php?t=1074403[/url]
[url]http://ubuntuforums.org/showthread.php?t=157289[/url]
配置:/etc/pam.d
1./etc/pam.d/common-account
2./etc/pam.d/common-auth
3./etc/pam.d/common-password
4./etc/pam.d/common-session
现在的进行一下其他设置:假设A已经设置好了ldap+ssh访问,现在设想机器B使用A的LDAP数据库来进行用户认证。
A的设置如下:
/etc/default/slapd
这样可以允许从外部访问。(机器B)
B的设置如下:
这在之前也需要文章上部分设置pam等。
/etc/ldap.conf
grep sshd /var/log/auth.log
pam的描述:
[url]http://www.ubuntuchina.com/viewthread.php?tid=5630[/url]
准备工作:
1.安装openldap
sudo apt-get install slapd ldap-utils
2.安装openssh
sudo apt-get install openssh-server
需要配置的文件:
/etc/nsswitch.conf 和/etc/pam.d
这是我的配置:/etc/nssitch
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.
# pre_auth-client-config # passwd: compat
passwd: files ldap
# pre_auth-client-config # group: compat
group: files ldap
# pre_auth-client-config # shadow: compat
shadow: files ldap
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
# pre_auth-client-config # netgroup: nis
netgroup: nis
参考:[url]http://ubuntuforums.org/showthread.php?t=1074403[/url]
[url]http://ubuntuforums.org/showthread.php?t=157289[/url]
配置:/etc/pam.d
1./etc/pam.d/common-account
account sufficient pam_ldap.so
account required pam_unix.so2./etc/pam.d/common-auth
auth sufficient pam_ldap.so
auth required pam_unix.so nullok_secure use_first_pass3./etc/pam.d/common-password
password sufficient pam_ldap.so
password required pam_unix.so nullok obscure min=4 max=8 md54./etc/pam.d/common-session
session required pam_unix.so
session required pam_mkhomedir.so skel=/etc/skel/
session optional pam_ldap.so
session optional pam_foreground.so现在的进行一下其他设置:假设A已经设置好了ldap+ssh访问,现在设想机器B使用A的LDAP数据库来进行用户认证。
A的设置如下:
/etc/default/slapd
SLAPD_SERVICES="ldap://192.168.236.179:389/ ldaps:/// ldapi:///"这样可以允许从外部访问。(机器B)
B的设置如下:
这在之前也需要文章上部分设置pam等。
/etc/ldap.conf
# network or connect timeouts (see bind_timelimit).
host 192.168.236.179
# The distinguished name of the search base.
base dc=liyh,dc=local
# Another way to specify your LDAP server is to provide an
uri ldap://192.168.236.179/
2063

被折叠的 条评论
为什么被折叠?



