linux使用了不安全的端口,linux – 使用不安全的端口为nfs安装

为什么不使用iptables来阻止这些你不想使用的端口(范围).确保将其作为拒绝规则并且不丢弃它,在后一种情况下可能需要更长时间,因为连接尝试超时.

典型规则可能如下所示:

/sbin/iptables -I OUTPUT -d 0/0 -j REJECT --reject-with icmp-net-prohibited -p tcp --dport XX -o ethX

/sbin/iptables -I OUTPUT -d 0/0 -j REJECT --reject-with icmp-net-prohibited -p udp --dport XX -o ethX

对于端口范围使用:

--dport XX:YY

对于传入:

/sbin/iptables -I INPUT -s 0/0 -j REJECT --reject-with icmp-net-prohibited -p tcp --dport XX -i ethX

/sbin/iptables -I INPUT -s 0/0 -j REJECT --reject-with icmp-net-prohibited -p udp --dport XX -i ethX

更新:可能从手册中为rpc.mountd添加正确的选项对您有用:

-p or --port num

Force rpc.mountd to bind to the specified port num, instead of using the random port number assigned by the portmapper.

在Debian中,您可以在/ etc / default / nfs-kernel-server中执行此操作,向此行添加选项:

# Options for rpc.mountd.

# If you have a port-based firewall, you might want to set up

# a fixed port here using the --port option. For more information,

# see rpc.mountd(8) or http://wiki.debian.org/?SecuringNFS

RPCMOUNTDOPTS=--manage-gids

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值