#查看防火墙状态
[root@CentOs57 ~]# /etc/init.d/iptables status
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
Chain FORWARD (policy ACCEPT)
num target prot opt source destination
Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
#启动防火墙
[root@CentOs57 ~]# /etc/init.d/iptables start
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: filter [ OK ]
Unloading iptables modules: [ OK ]
[root@CentOs57 ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
#设置防火墙开机启动
[root@CentOs57 ~]# chkconfig iptables on
#设置开机启动是否成功(2到5均为on表示成功)
[root@CentOs57 ~]# chkconfig --list iptables
iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@CentOs57 ~]#
在线安装openldap
[root@CentOs57 ~]# rpm -qa|grep openldap
openldap-devel-2.3.43-3.el5
openldap-2.3.43-3.el5
openldap-clients-2.3.43-3.el5
You have new mail in /var/spool/mail/root
[root@CentOs57 ~]# yum install openldap openldap-servers openldap-clients
#更改默认邮寄发送程序
[root@CentOs57 pam.d]# alternatives --config mta
There are 2 programs which provide 'mta'.
Selection Command
-----------------------------------------------
*+ 1 /usr/sbin/sendmail.sendmail
2 /usr/sbin/sendmail.postfix
Enter to keep the current selection[+], or type selection number:
[1]+ Stopped alternatives --config mta
You have new mail in /var/spool/mail/root
#linux查找某文件
[root@redhat170 dovecot-2.0.2]# find / -name dovecot.conf
#sasldb创建账号
[root@redhat170 skel]# saslpasswd2 -c -u `postconf -h myhostname` test
Password:
Again (for verification):
#查看sasldb已有账号
[root@redhat170 skel]# sasldblistusers2
test@redhat: userPassword
#OpenLDAP使用的ldif文件示例, 注意空格
dn: dc=example,dc=com
objectclass: dcobject
objectclass: organization
o: example
dc: example
dn: cn=Jephe Wu,dc=example,dc=com
objectclass: inetorgperson
cn: Jephe Wu
sn: Wu
mail: jephe_wu@yourdomain.com
#导入ldif文件
ldapadd -x -D "cn=Manager,dc=example,dc=com" -w password -f example.ldif
#查找所有object
ldapsearch -x -b 'dc=example,dc=com' '(objectclass=*)'
#查看postfix是否编译了dovecot, 如果看到了dovecot。即是编译了
[root@alattin sasl2]# postconf -a
cyrus
dovecot