1.chattr权限问题:
在我运行chattr -i /usr/bin/netstat出现
bash: /usr/bin/chattr: Permission denied
我的解决方案
[root@c7 bin]# cd /usr/bin
[root@c7 bin]# ls -lh chattr;lsattr chattr
-rw-r--r--. 1 root root 12K Jun 9 19:59 chattr
----i----------- chattr
[root@c7 bin]# cp chattr chattr.new
[root@c7 bin]# chmod a+x chattr.new
[root@c7 bin]# chattr.new -i chattr
[root@c7 bin]# rm -f chattr.new
[root@c7 bin]# chmod a+x chattr
[root@c7 bin]# ls -lh chattr;lsattr chattr
-rwxr-xr-x. 1 root root 12K Jun 9 19:59 chattr
---------------- chattr
2.netstat 权限问题:
在我运行netstat -ntlp出现
bash: /usr/bin/netstat: Permission denied
我的解决方案
[root@c7 bin]# lsattr /usr/bin/netstat
-------i------e-- /usr/bin/netstat
[root@c7 bin]# chattr -i /usr/bin/netstat
[root@c7 bin]# chmod 755 /usr/bin/netstat
[root@c7 bin]# netstat -nltp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local

本文介绍了在Linux系统中解决chattr和netstat权限问题的方法,并总结了chmod命令的使用技巧。
最低0.47元/天 解锁文章
880

被折叠的 条评论
为什么被折叠?



