Author Topic: lsattr และ chattr เอาไว้ทำอะไร แก้ operation not permitted  (Read 1239 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2141
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
เมื่อเวลา รัน command เช่น rm , mv ไปที่บางไฟล์แล้วว่า operation not permitted

เราสามารถทำการเชค permission ไฟล์โดย

lsattr entpdate.service
ถ้าเป็น

#cd /etc/systemd
lsattr entpdate.service
----ia-------e-- entpdate.service

จะไม่สามารถ rm , mv ได้ ต้องทำการปลดสิทธิ์ของไฟล์นี้ออกก่อน

# chattr -ia entpdate.service

แล้วทำการเชค lsattr อีกที
# lsattr entpdate.service
-------------e-- entpdate.service

จะสามารถทำการ rm , mv ไฟล์นั้นได้

ในกรณีโดน trojan ฝังใน linux

===How to Found and Fixed 
0.Check process high cpu or check download trojan packet
1.Check crontab on normal user and user: root
2.cd /etc/systemd found 3 services starting for trojan services
3.found command on /bin and /sbin then “chattr -ia file”
4.reboot server 1 times.
« Last Edit: กันยายน 17, 2023, 03:15:31 PM by golfreeze »