snmpd服务无法更改默认端口

问题描述:

修改/etc/rc.d/init.d/snmpd的启动脚本

修改行:

OPTIONS="-Lsd -Lf /dev/null -p /var/run/snmpd.pid -a"

修改为

OPTIONS="udp:9999 -Lsd -Lf /dev/null -p /var/run/snmpd.pid -a"

service snmpd start 时无法启动该服务,终端没有报错提示

问题解决:

tail -10 /var/log/messages

Aug 24 09:36:24 localhost snmpd[12063]: Error opening specified endpoint "udp:9999" 
Aug 24 09:36:24 localhost snmpd[12063]: Server Exiting with code 1 
Aug 24 09:36:24 localhost setroubleshoot: SELinux is preventing the snmpd (snmpd_t) from binding to port 9999. For complete SELinux messages. run sealert -l ec7e5602-a40f-4831-97d0-ca9e84618549

 

so,暂且不考虑selinux,命令关掉selinux

setenforce 0

sestatus

SELinux status: enabled 
SELinuxfs mount: /selinux 
Current mode: permissive 
Mode from config file: disabled 
Policy version: 21 
Policy from config file: targeted

 

稍后会继续详细介绍selinux,安全却很少人探索的东东!


本文转自    geekwolf   51CTO博客,原文链接:http://blog.51cto.com/linuxgeek/995245

你可能感兴趣的:(网络)