存档

‘Linux’ 分类的存档

Iptables logging, separating and sorting logs (syslog-ng)

2010年2月28日 没有评论

Every user using logs met requirement to separate logs from various daemons to individual files and log iptables actions. In this topic we will set up syslog-ng a system loger to do it. Log files will be separated by services (DNS daemon, DHCP daemon, …), iptables logged actions and by months and years.

How to log iptables?

In chain where for example logging of dropped packets is desired we add logging rule to the end of chain (valid for iptables with implicit policy DROP on INPUT chain). If you don’t want make your router/server crazy, set limit for logged packets.
阅读全文...

分类: Linux 标签: ,

iptables 基本命令使用举例

2010年2月26日 没有评论

iptables 指令
语法:
iptables [-t table] command [match] [-j target/jump]
-t 参数用来指定规则表,内建的规则表有三个,分别是:nat、mangle 和 filter,当未指定规则表时,则一律视为是 filter。
个规则表的功能如下:
阅读全文...

分类: Linux 标签: , ,

Linux中开启MySQL远程访问功能

2010年2月25日 没有评论

(1)确认一下3306是否对外开放,MySQL默认状态下是不开放对外访问功能的。查看的办法如下:

~# netstat -an | grep 3306
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN

从上面可以看出,mysql的3306端口只是监听本地的连接,这样就阻碍了外部IP对该数据库的访问,修改的办法其实很简单,进入到mysql的配置文件所在目录(/etc/mysql/my.cnf)下,找到文件中的如下内容:
阅读全文...

分类: Linux 标签: , ,

linux启动是自动加载的几个文件说明bashrc等

2010年2月25日 2 条评论

(1)/etc/profile
全局(公有)配置,不管是哪个用户,登录时都会读取该文件。

(2)/ect/bashrc
Ubuntu没有此文件,与之对应的是/ect/bash.bashrc
它也是全局(公有)的
bash执行时,不管是何种方式,都会读取此文件。

(3)~/.profile
若bash是以login方式执行时,读取~/.bash_profile,若它不存在,则读取~/.bash_login,若前两者不存在,读取~/.profile。
另外,图形模式登录时,此文件将被读取,即使存在~/.bash_profile和~/.bash_login。
阅读全文...

分类: Linux 标签: , , ,

debian设置vim颜色与SecureCRT颜色命令行终端颜色(彩色的文件及文件夹)

2010年2月25日 没有评论

在debian下设置vim的颜色,需要更改vimrc这个文件,改动前请记得备份,以防修改错误。

debian:~# cp /etc/vim/vimrc /etc/vim/vimrc.bak

编辑vimrc文件

debian:~# vi /etc/vim/vimrc

阅读全文...

分类: Linux 标签: , , , ,