[DEBUG] Linux resolve error ‘chmod: changing permissions of ‘resolv.conf’: Operation not permitted’

Error Reporting Command

# chmod 644 resolv.conf

Error Code

chmod: changing permissions of 'resolv.conf': Operation not permitted

Analysis

This file is locked by chattr command

Solution

Step One: Cancel the lock

# chattr -i /etc/resolv.conf

Step Two: Change the file’s privilege

# chmod 644 resolv.conf

Step Three: Relock this file

# chattr +i /etc/resolv.conf

[内容] iptables 防火墙数据接收情况和发出情况的查看

# iptables -nvL

Chain INPUT (policy ACCEPT 5 packets, 500 bytes)
......
Chain FORWARD (policy DROP 0 packets, 0 bytes)
......
Chain OUTPUT (policy DROP 1000 packets, 200K bytes)
......


补充:
1) 这里的 policy ACCEPT 5 packets, 500 bytes 是指接收了 5 个数据包和 500 bytes 流量,ACCEPT 是指接收的状态
2) 这里的 policy DROP 1000 packets, 200K bytes 是指发出了 1000 数据包和 200K bytes 流量。DROP 是拒绝的状态