易截截图软件、单文件、免安装、纯绿色、仅160KB

Linux下防止文件误删除的特殊方法

通常要用一些特殊的方法,防止误删除,其实误删除是可以防止的,特意删除是无法防止的。
误删除,通常是chattr +i filename
[root@imdba imdba_t2]# ls -ltr
total 116
-rw-rw—- 1 mysql mysql    61 Oct 17 16:08 db.opt
-rw-rw—- 1 mysql mysql  8556 Oct 17 16:09 imdba_t2_t.frm
-rw-rw—- 1 mysql mysql 98304 Oct 17 16:09 imdba_t2_t.ibd
[root@imdba imdba_t2]# chattr +i *
[root@imdba imdba_t2]# lsattr
—-i——– ./imdba_t2_t.ibd
—-i——– ./imdba_t2_t.frm
—-i——– ./db.opt
(root:NovaTestDB:Sat Oct 17 16:09:50 2009)[imdba_t2]> drop database imdba_t2;
ERROR 6 (HY000): Error on delete of ‘./imdba_t2//db.opt’ (Errcode: 1)
看上去这样可以防止一些人误删除,这样是不是感觉自己很聪明,别人很傻,就限制住了别人删除了呢?其实不然,看下面
(root:NovaTestDB:Sat Oct 17 16:10:08 2009)[imdba_t2]>
[root@imdba imdba_t2]# chattr -i *
[root@imdba imdba_t2]# lsattr
————- ./imdba_t2_t.ibd
————- ./imdba_t2_t.frm
————- ./db.opt
(root:NovaTestDB:Sat Oct 17 16:10:44 2009)[imdba_t2]> drop database imdba_t2;
Query OK, 1 row affected (0.01 sec)
是不是人家又把你的数据库删除了,哎,貌似是骗人的把戏。
经典的手法出现了,看 LCAP
介绍如下:
lcap allows a system administrator to remove specific capabilities from
the kernel in order to make the system more secure. lcap modifies the
value in the sysctl file /proc/sys/kernel/cap-bound. “Capabilities” are
a form of kernel-based access control. Linux kernel versions 2.2.11 and
greater include the idea of a “capability bounding set,” a list of
capabilities that can be held by any process on the system. If a
capability is removed from the bounding set, the capability may not be
used by any process on the system (even processes owned by root).
如果你不知道是啥,哎,搞“系统安全”的不能不知道这个网址:
http://packetstorm


相关文档:

Linux 安装 Mysql

 一、引言
  想使用Linux已经很长时间了,由于没有硬性任务一直也没有系统学习,近日由于工作需要必须使用Linux下的MySQL。本以为有
Windows下使用SQL
Server的经验,觉得在Linux下安装MySql应该是易如反掌的事,可在真正安装和使用MySQL时走了很多弯路,遇见很多问题,毕竟Linux
和Windows本身就有很大区别。为了让 ......

Linux下飞信


#!/bin/sh
  
# define default value
  
URL='https://fetionapi.appspot.com/api/'
  
# your phone number
  
from='13600000000'
  
# your fetion password
  
PW='password'
   ......

Linux Kernel in a Nutshel

Linux Kernel in a Nutshell
By Greg Kroah-Hartman
...............................................
Publisher: O'Reilly
Pub Date: December 01, 2006
ISBN-10: 0-596-10079-5
ISBN-13: 978-0-596-10079-7
Pages: 352
Written by a leading developer and maintainer of the Linux kernel,
Linux Kern ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号