# default: off
# description: The CVS service can record the history of your source \
# files. CVS stores all the versions of a file in a single \
# file in a clever way that only stores the differences \
# between versions.
service cvspserver
{
disable = no
port = 2401
socket_type = stream
protocol = tcp
wait = no
user = root
passenv = PATH
server = /usr/bin/cvs
# env = HOME=/var/cvs
env = HOME=/home/cvsroot
# server_args = -f --allow-root=/var/cvs pserver
server_args = -f --allow-root=/home/cvsroot pserver
# bind = 127.0.0.1
}
[iyunv@localhost /]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
把SELINUX=enforce 改成disabled就可以了,重启电脑,永久生效
[iyunv@localhost CVSROOT]# cvs -d:pserver:cvsroot@XXX.28.146.116:/home/cvsroot login
Logging in to :pserver:cvsroot@XXX.28.146.116:2401/home/cvsroot
CVS password:
[iyunv@localhost CVSROOT]#
三、centos防火墙
查看运行的状态
[iyunv@localhost CVSROOT]# /etc/init.d/iptables status
iptables: Firewall is not running.
[iyunv@localhost CVSROOT]# service iptables status
iptables: Firewall is not running.
[iyunv@localhost CVSROOT]# /etc/init.d/iptables status
iptables: Firewall is not running.
[iyunv@localhost CVSROOT]# /etc/init.d/iptables start
iptables: Applying firewall rules: [ OK ]
[iyunv@localhost CVSROOT]# /etc/init.d/iptables status
Table: filter
……………………
[iyunv@localhost CVSROOT]# /etc/init.d/iptables stop
3、 打开iptables的配置文件直接修改,这个永久有效:
vi /etc/sysconfig/iptables
直接安装22端口的设置复制一行,呵呵
1、这个不起使用呀
[iyunv@localhost CVSROOT]# chkconfig iptables
[iyunv@localhost CVSROOT]# chkconfig iptables on
[iyunv@localhost CVSROOT]# service iptables status
iptables: Firewall is not running.
2、 即时生效,重启后失效:
开启: service iptables start
关闭: service iptables stop
这个起作用,
需要说明的是对于Linux下的其它服务都可以用以上命令执行开启和关闭操作。
在开启了防火墙时,做如下设置,开启相关端口,
修改/etc/sysconfig/iptables 文件,添加以下内容:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 2401 -j ACCEPT
或者:
/etc/init.d/iptables status 会得到一系列信息,说明防火墙开着。
/etc/rc.d/init.d/iptables stop 关闭防火墙