openldap+ssh 登录 ubuntu 9.04

查看远程用户ssh登录信息:
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.so

2./etc/pam.d/common-auth
auth    sufficient      pam_ldap.so
auth required pam_unix.so nullok_secure use_first_pass

3./etc/pam.d/common-password
password        sufficient      pam_ldap.so
password required pam_unix.so nullok obscure min=4 max=8 md5

4./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/
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值