opensue 下的CVS 远程设置与排错

远程连接错误及解决

本次实现宿主机为opensuse tumbleweed,远程连接的机器为rhel6.0,且在同一LAN下,suse的ip:192.168.3.109
在rhel6.0系统下/etc/services文件是记录网络服务名和它们对应使用的端口号及协议,不过这里不用设置

No route to host
[tom@ton ~]$cvs login
Logging in to :pserver:anonymous@192.168.3.109:2401/home/tom/cvs/test/tom-csv
CVS password: 
cvs [login aborted]: connect to [192.168.3.109]:2401 failed: No route to host
[tom@ton ~]$telnet 192.168.3.109 2401					#测试发现2401口未开放
Trying 192.168.3.109...
telnet: connect to address 192.168.3.109: No route to host
开放2401端口
firewall-cmd --permanent --add-port=2401/tcp						
firewall-cmd --reload
Connection refused
[tom@ton ~]$cvs login
Logging in to :pserver:tom@192.168.3.109:2401/home/tom/cvs
CVS password: 
cvs [login aborted]: connect to [192.168.3.109]:2401 failed: Connection refused
添加xinetd脚本

/etc/xinetd.d/cvspserver文件,为连接到本机的2401端口的客户自动启动一个cvs会话,端口2401是标准的cvs服务监听端口。

# CVS pserver (remote acces to your CVS repositories)
# Please read the section on security and passwords in the CVS manual,
# before you enable this.
# default: off

service cvspserver
{
        disable         = no
        socket_type     = stream
        protocol        = tcp
        port            = 2401
        wait            = no
        user            = root
        server          = /usr/bin/cvs
        server_args     = -f --allow-root=/home/tom/cvs pserver
}
suse-tom:~ # vim /etc/xinetd.d/cvspserver
suse-tom:~ # service xinetd restart

可以看到xinetd对2401端口做了监听

suse-tom:/etc/xinetd.d # sudo lsof -i -n -P | grep xinetd
xinetd    13378  root    5u  IPv6  57193      0t0  TCP *:2401 (LISTEN)
xinetd    13378  root    6u  IPv6  57194      0t0  TCP *:13 (LISTEN)

或者netstat一下

[tom@suse-tom tom-csv]$sudo netstat -tnl |grep 2401
tcp6       0      0 :::2401                 :::*                    LISTEN
no such repository
[tom@ton ~]$cvs login   
Logging in to :pserver:anonymous@192.168.3.109:2401/home/tom/cvs/test/tom-csv
CVS password: 
cvs [login aborted]: unrecognized auth response from 192.168.3.109: cvs [pserver aborted]: /home/tom/cvs/test/tom-csv: no such repository

原因:指定的仓库中与上面pserver xinetd配置中的–allow-root = 选项不相匹配

[tom@ton ~]$vim .bashrc 
[tom@ton ~]$source .bashrc 

即没有正确地设置环境变量CVSROOT

export CVSROOT=:pserver:tom@192.168.3.109:$HOME/cvs/test/tom-csv         #更改为
export CVSROOT=:pserver:tom@192.168.3.109:$HOME/cvs 

上述报错仍没有解决可以考虑一下远程连接的机器的问题,尝试关闭iptables在rhel6.0上

[tom@ton ~]$sudo service iptables stop
[sudo] password for tom: 
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]
成功连接
[tom@ton ~]$cvs login
Logging in to :pserver:tom@192.168.3.109:2401/home/tom/cvs
CVS password: 
[tom@ton ~]$

参考https://danilodellaquila.com/en/blog/install-cvs-server-on-suse-11

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值