<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Security Team Blog &#187; Parallels</title>
	<atom:link href="http://www.secblog.cn/category/prima/feed" rel="self" type="application/rss+xml" />
	<link>http://www.secblog.cn</link>
	<description>服务器系统架构、优化及网络安全</description>
	<lastBuildDate>Tue, 29 Nov 2011 02:15:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Prim@hosting For Centos5下Memcache安装优化</title>
		<link>http://www.secblog.cn/prima/847.html</link>
		<comments>http://www.secblog.cn/prima/847.html#comments</comments>
		<pubDate>Mon, 27 Sep 2010 16:26:19 +0000</pubDate>
		<dc:creator>豬頭濱</dc:creator>
				<category><![CDATA[Parallels]]></category>

		<guid isPermaLink="false">http://www.secblog.cn/?p=847</guid>
		<description><![CDATA[一.unix下安装Memcache服务器端 1.安装libevent： # cd /usr/local/src/ # wget -nc http://www.monkey.org/~provos/libevent-1.4.13-stable.tar.gz #tar zxvf libevent-1.4.13-stable.tar.gz # cd libevent-1.4.13-stable # ./configure -prefix=/usr # make # make install 2.安装Memcache # cd /usr/local/src/ # wget -nc http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz # tar zxvf memcached-1.4.5.tar.gz # cd memcached-1.4.5 # ./configure -with-libevent=/usr # make # make install 3.安装zlib # cd /usr/local/src/ # wget -nc http://zlib.net/zlib-1.2.5.tar.gz # [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.secblog.cn/wp-content/uploads/2010/09/memcache.jpg"><img class="alignnone size-full wp-image-851" title="memcache" src="http://www.secblog.cn/wp-content/uploads/2010/09/memcache.jpg" alt="" width="615" height="352" /></a><br />
一.unix下安装Memcache服务器端</p>
<p>1.安装libevent：<br />
# cd /usr/local/src/<br />
# wget -nc http://www.monkey.org/~provos/libevent-1.4.13-stable.tar.gz<br />
#tar zxvf libevent-1.4.13-stable.tar.gz<br />
# cd libevent-1.4.13-stable<br />
# ./configure -prefix=/usr<br />
# make<br />
# make install</p>
<p>2.安装Memcache<br />
# cd /usr/local/src/<br />
# wget -nc http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz<br />
# tar zxvf memcached-1.4.5.tar.gz<br />
# cd memcached-1.4.5<br />
# ./configure -with-libevent=/usr<br />
# make<br />
# make install</p>
<p>3.安装zlib<br />
# cd /usr/local/src/<br />
# wget -nc http://zlib.net/zlib-1.2.5.tar.gz<br />
# tar zxvf zlib-1.2.5.tar.gz<br />
# cd zlib-1.2.5<br />
# ./configure &#8211;shared<br />
# make<br />
# make install</p>
<p>二.安装Memcache的PHP扩展</p>
<p>1.安装Memcache的PHP扩展</p>
<p># cd /usr/local/src/<br />
# wget http://pecl.php.net/get/memcache-2.2.5.tgz<br />
# tar zxvf memcache-2.2.5.tgz<br />
# cd memcache-2.2.5<br />
# /usr/local/php5/bin/phpize<br />
# ./configure -enable-memcache -with-php-config=/usr/local/php5/bin/php-config -with-zlib-dir<br />
# make<br />
# make install<br />
如果不报错，安装以后会出现：<br />
Installing shared extensions:     /usr/local/php5/lib/php/</p>
<p>2.添加Memcache扩展<br />
# vi /usr/local/php5/etc/php.ini<br />
然后在下面添加：extension=memcache.so 来加载</p>
<p>3.启动Memcache的服务器端：<br />
# /usr/local/bin/memcached -d -m 1024 -u root -l 127.0.0.1 -p 11211 -c 1000 -P /tmp/memcached.pid<br />
-d选项是启动一个守护进程，<br />
-m是分配给Memcache使用的内存数量，单位是MB，我这里是1024MB，<br />
-u是运行Memcache的用户，我这里是root，<br />
-l是监听的服务器IP地址<br />
-p是设置Memcache监听的端口，我这里设置了11211，最好是1024以上的端口，<br />
-c选项是最大运行的并发连接数，默认是1024，我这里设置了256，按照你服务器的负载量来设定，<br />
-P是设置保存Memcache的pid文件，我这里是保存在 /tmp/memcached.pid，<br />
要注意的是如果你的服务器有防火墙的话注意端口问题。</p>
<p>4.如果要结束Memcache进程，执行：<br />
# kill `cat /tmp/memcached.pid`</p>
<p>5.重启apache</p>
<p>6.测试你的Memcache环境</p>
<p>&lt;?php<br />
$mem = new Memcache;<br />
$mem-&gt;connect(“127.0.0.1&#8243;,11211);<br />
$mem-&gt;set(&#8216;key&#8217;, &#8216;This is a memcached test!&#8217;, 0, 60);<br />
$val = $mem-&gt;get(&#8216;key&#8217;);<br />
echo $val;<br />
?&gt;</p>
<p>7.让memcache在linux启动是自动启动，请编辑 /etc/rc.d/rc.local.加入：<br />
/usr/local/bin/memcached -d -m 1024 -u root -l 127.0.0.1 -p 11211 -c 1000 -P /tmp/memcached.pid</p>
]]></content:encoded>
			<wfw:commentRss>http://www.secblog.cn/prima/847.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>安装apc为php加速</title>
		<link>http://www.secblog.cn/prima/836.html</link>
		<comments>http://www.secblog.cn/prima/836.html#comments</comments>
		<pubDate>Mon, 16 Aug 2010 03:23:21 +0000</pubDate>
		<dc:creator>豬頭濱</dc:creator>
				<category><![CDATA[Parallels]]></category>

		<guid isPermaLink="false">http://www.secblog.cn/prima/836.html</guid>
		<description><![CDATA[Alternative PHP Cache（APC）是 PHP 的一个免费公开的优化代码缓存。它用来提供免费，公开并且强健的架构来缓存和优化 PHP 的中间代码。 主要是加速PHP.. WordPress是一个占用内存的大户,而且执行效率比较低.. 下面是安装方法: wget http://pecl.php.net/get/APC-3.1.2.tgz tar zxvf APC-3.1.2.tgz cd APC-3.1.2/ /usr/local/php5/bin/phpize ./configure &#8211;enable-apc &#8211;enable-apc-mmap &#8211;with-php-config=/usr/local/php5/bin/php-config make make install php.ini 查找extension_dir = “/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/” 下面添加extension = “apc.so” 配置php.ini 末尾加入 apc.enabled = 1 apc.cache_by_default = on apc.shm_segments = 1 apc.shm_size = 32 apc.ttl = 600 apc.user_ttl = 600 apc.num_files_hint = 0 [...]]]></description>
			<content:encoded><![CDATA[<p>Alternative PHP Cache（APC）是 PHP 的一个免费公开的优化代码缓存。它用来提供免费，公开并且强健的架构来缓存和优化 PHP 的中间代码。<br />
主要是加速PHP..<br />
WordPress是一个占用内存的大户,而且执行效率比较低..<br />
下面是安装方法:</p>
<blockquote><p>wget http://pecl.php.net/get/APC-3.1.2.tgz<br />
tar zxvf APC-3.1.2.tgz<br />
cd APC-3.1.2/<br />
/usr/local/php5/bin/phpize<br />
./configure &#8211;enable-apc &#8211;enable-apc-mmap &#8211;with-php-config=/usr/local/php5/bin/php-config<br />
make<br />
make install</p></blockquote>
<p>php.ini<br />
查找extension_dir = “/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/”<br />
下面添加extension = “apc.so”</p>
<p>配置php.ini 末尾加入<br />
apc.enabled = 1<br />
apc.cache_by_default = on<br />
apc.shm_segments = 1<br />
apc.shm_size = 32<br />
apc.ttl = 600<br />
apc.user_ttl = 600<br />
apc.num_files_hint = 0<br />
apc.write_lock = On</p>
]]></content:encoded>
			<wfw:commentRss>http://www.secblog.cn/prima/836.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>重新编译FreeBSD 5.3 Release内核使之支持SMP/HTT、QUOTA等功能</title>
		<link>http://www.secblog.cn/prima/798.html</link>
		<comments>http://www.secblog.cn/prima/798.html#comments</comments>
		<pubDate>Mon, 09 Aug 2010 05:27:22 +0000</pubDate>
		<dc:creator>豬頭濱</dc:creator>
				<category><![CDATA[Parallels]]></category>

		<guid isPermaLink="false">http://www.secblog.cn/?p=798</guid>
		<description><![CDATA[reeBSD 5.3 Release 默认内核不支持Xeon CPU的多路对称处理器和超线程功能，需要重新编译内核。 解决方案 与Linux内核为性能做优化不同，FreeBSD的内核是为稳定性做的优化，而且支持的设备上有所保留。所以使用FreeBSD通常意味着需要自己编译 内核，开启诸如SMP/HTT、IPFirewall等功能。同时，也可以将无用的驱动模块去掉，缩小内核体积，进一步提高稳定性和性能。 注：本文仅供参考，具体参数可能根据FreeBSD不同版本而有所不同。 －－－－－－－－－－－－－－－－－－－－－ ■■■■编译定制内核■■■■ 1) 我们需要使用FreeBSD 5.3 Release的安装光盘装好一个默认的系统，安装时候一定要选择“Kern-Developer”，即安装编译内核所需要的组件。然后选择屏幕最下边的 Custom，按空格进入下一层菜单，在里边找到src，按空格进入下一层菜单，选中sys，即安装内核源代码到/usr/src/sys目录下。 2) 使用默认的内核启动系统。备份当前的内核： cp -R /boot/kernel /boot/kernel.good 这样当新内核出现问题时候，可以随时恢复到原内核。 3) 复制默认内核的配置文件，并且重新命名： /usr/src/sys/i386/conf cp GENERIC Prima-Kernel 4) 修改内核配置文件： vi Prima-Kernel 查找关键字“ident”，并修改如下: ident Prima-Kernel # set kern&#8217;s name 为了支持SMP多对称处理器和HTT超线程，在文件中加入下内容： options SMP # Symmetric MultiProcessor Kernel 为了优化网络性能，添加如下参数： options TCP_DROP_SYNFIN options ZERO_COPY_SOCKETS 加入Quota磁盘配额的支持： options QUOTA [...]]]></description>
			<content:encoded><![CDATA[<p>reeBSD 5.3 Release 默认内核不支持Xeon CPU的多路对称处理器和超线程功能，需要重新编译内核。</p>
<table border="0" cellspacing="1" cellpadding="4" width="100%">
<tbody>
<tr>
<td>解决方案</td>
</tr>
<tr>
<td>与Linux内核为性能做优化不同，FreeBSD的内核是为稳定性做的优化，而且支持的设备上有所保留。所以使用FreeBSD通常意味着需要自己编译 内核，开启诸如SMP/HTT、IPFirewall等功能。同时，也可以将无用的驱动模块去掉，缩小内核体积，进一步提高稳定性和性能。</p>
<p>注：本文仅供参考，具体参数可能根据FreeBSD不同版本而有所不同。</p>
<p>－－－－－－－－－－－－－－－－－－－－－</p>
<p>■■■■编译定制内核■■■■</p>
<p>1) 我们需要使用FreeBSD 5.3  Release的安装光盘装好一个默认的系统，安装时候一定要选择“Kern-Developer”，即安装编译内核所需要的组件。然后选择屏幕最下边的 Custom，按空格进入下一层菜单，在里边找到src，按空格进入下一层菜单，选中sys，即安装内核源代码到/usr/src/sys目录下。</p>
<p>2) 使用默认的内核启动系统。备份当前的内核：</p>
<p>cp -R /boot/kernel /boot/kernel.good</p>
<p>这样当新内核出现问题时候，可以随时恢复到原内核。</p>
<p>3) 复制默认内核的配置文件，并且重新命名：</p>
<p>/usr/src/sys/i386/conf<br />
cp GENERIC Prima-Kernel</p>
<p>4) 修改内核配置文件：<br />
vi Prima-Kernel</p>
<p>查找关键字“ident”，并修改如下:<br />
ident Prima-Kernel # set kern&#8217;s name</p>
<p>为了支持SMP多对称处理器和HTT超线程，在文件中加入下内容：<br />
options SMP # Symmetric MultiProcessor Kernel</p>
<p>为了优化网络性能，添加如下参数：<br />
options TCP_DROP_SYNFIN<br />
options ZERO_COPY_SOCKETS</p>
<p>加入Quota磁盘配额的支持：<br />
options QUOTA</p>
<p>注意：内核配置文件的注释说：“Do not remove isa, even if you have no isa slots”。即使没有ISA插槽，也不要去掉ISA支持，否则会导致系统崩溃。</p>
<p>5) 编译并安装新内核：</p>
<p>/usr/sbin/config Prima-Kernel<br />
cd ../compile/Prima-Kernel/<br />
make depend<br />
make<br />
make install</p>
<p>注意：整个编译估计需要15分钟左右，根据CPU速度而定。</p>
<p>6) 重新启动系统，默认就会启动新内核。</p>
<p>－－－－－－－－－－－－－－－－－－－－－</p>
<p>■■■■内核升级失败时使用其他内核文件启动■■■■</p>
<p>1) 启动系统时候，出现1到7的选项列表，按下6。</p>
<p>2) 现在进入提示符“OK”状态，可以进行如下操作：</p>
<p>如果需要启动当前系统内核，则输入：<br />
boot kernel</p>
<p>如果需要启动上一个版本的内核，则输入：<br />
boot kernel.old</p>
<p>假如编译新内核前按照本文将原内核备份成了kernel.good，则输入如下内容可以启动这个备份内核：<br />
boot kernel.good</p>
<p>用别的内核启动成功之后，将可以正常使用的内核复制承认默认内核：<br />
rm -rf /boot/kernel<br />
cp -R /boot/kernel.good /boot/kernel</p>
<p>重新启动系统，即可使用原内核正常运行。</p>
<p>－－－－－－－－－－－－－－－－－－－－－</p>
<p>■■■■典型Prima-Kernel内核配置文件■■■■</p>
<p>注意：本配置文件来自FreeBSD 5.3 Release，支持SMP和HTT，仅保留了对Intel板载网卡（em/fxp）以及AIC7xxx SCSI适配器的支持，如果需要支持其他设备，请启用相关配置项。</p>
<p>#<br />
# GENERIC &#8212; Generic kernel configuration file for FreeBSD/i386<br />
#<br />
# For more information on this file, please read the handbook section on<br />
# Kernel Configuration Files:<br />
#<br />
#    <a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html">http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html</a><br />
#<br />
# The handbook is also available locally in /usr/share/doc/handbook<br />
# if you&#8217;ve installed the doc distribution, otherwise always see the<br />
# FreeBSD World Wide Web server (<a href="http://www.freebsd.org/%29">http://www.FreeBSD.org/)</a> for the<br />
# latest information.<br />
#<br />
# An exhaustive list of options and more detailed explanations of the<br />
# device lines is also present in the ../../conf/NOTES and NOTES files.<br />
# If you are in doubt as to the purpose or necessity of a line, check first<br />
# in NOTES.<br />
#<br />
# $FreeBSD: src/sys/i386/conf/GENERIC,v 1.413.2.6.2.2 2004/10/24 18:02:52 scottl Exp $</p>
<p>machine		i386<br />
#cpu		I486_CPU<br />
#cpu		I586_CPU<br />
cpu		I686_CPU<br />
ident		Prima-Kernel</p>
<p># To statically compile in device wiring instead of /boot/device.hints<br />
#hints		“GENERIC.hints”		# Default places to look for devices.</p>
<p>options 	SCHED_4BSD		# 4BSD scheduler<br />
options 	INET			# InterNETworking<br />
#options 	INET6			# IPv6 communications protocols<br />
options 	FFS			# Berkeley Fast Filesystem<br />
options 	SOFTUPDATES		# Enable FFS soft updates support<br />
options 	UFS_ACL			# Support for access control lists<br />
options 	UFS_DIRHASH		# Improve performance on big directories<br />
options 	MD_ROOT			# MD is a potential root device<br />
#options 	NFSCLIENT		# Network Filesystem Client<br />
#options 	NFSSERVER		# Network Filesystem Server<br />
#options 	NFS_ROOT		# NFS usable as /, requires NFSCLIENT<br />
#options 	MSDOSFS			# MSDOS Filesystem<br />
options 	CD9660			# ISO 9660 Filesystem<br />
options 	PROCFS			# Process filesystem (requires PSEUDOFS)<br />
options 	PSEUDOFS		# Pseudo-filesystem framework<br />
options 	GEOM_GPT		# GUID Partition Tables.<br />
options 	COMPAT_43		# Compatible with BSD 4.3 [KEEP THIS!]<br />
options 	COMPAT_FREEBSD4		# Compatible with FreeBSD4<br />
options 	SCSI_DELAY=5000 	# Delay (in ms) before probing SCSI<br />
options 	KTRACE			# ktrace(1) support<br />
options 	SYSVSHM			# SYSV-style shared memory<br />
options 	SYSVMSG			# SYSV-style message queues<br />
options 	SYSVSEM			# SYSV-style semaphores<br />
options 	_KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions<br />
options 	KBD_INSTALL_CDEV	# install a CDEV entry in /dev<br />
options 	AHC_REG_PRETTY_PRINT	# Print register bitfields in debug<br />
# output.  Adds ~128k to driver.<br />
options 	AHD_REG_PRETTY_PRINT	# Print register bitfields in debug<br />
# output.  Adds ~215k to driver.<br />
options 	ADAPTIVE_GIANT		# Giant mutex is adaptive.</p>
<p>device		apic		# I/O APIC</p>
<p>options SMP<br />
options APIC_IO<br />
options QUOTA<br />
options TCP_DROP_SYNFIN<br />
options ZERO_COPY_SOCKETS</p>
<p># Bus support.  Do not remove isa, even if you have no isa slots<br />
device		isa<br />
device		eisa<br />
device		pci</p>
<p># Floppy drives<br />
#device		fdc</p>
<p># ATA and ATAPI devices<br />
device		ata<br />
#device		atadisk		# ATA disk drives<br />
#device		ataraid		# ATA RAID drives<br />
device		atapicd		# ATAPI CDROM drives<br />
#device		atapifd		# ATAPI floppy drives<br />
#device		atapist		# ATAPI tape drives<br />
options 	ATA_STATIC_ID	# Static device numbering</p>
<p># SCSI Controllers<br />
#device		ahb		# EISA AHA1742 family<br />
device		ahc		# AHA2940 and onboard AIC7xxx devices<br />
#device		ahd		# AHA39320/29320 and onboard AIC79xx devices<br />
#device		amd		# AMD 53C974 (Tekram DC-390(T))<br />
#device		isp		# Qlogic family<br />
#device		mpt		# LSI-Logic MPT-Fusion<br />
#device		ncr		# NCR/Symbios Logic<br />
#device		sym		# NCR/Symbios Logic (newer chipsets + those of `ncr&#8217;)<br />
#device		trm		# Tekram DC395U/UW/F DC315U adapters<br />
#device		adv		# Advansys SCSI adapters<br />
#sdevice		adw		# Advansys wide SCSI adapters<br />
#device		aha		# Adaptec 154x SCSI adapters<br />
#device		aic		# Adaptec 15[012]x SCSI adapters, AIC-6[23]60.<br />
#device		bt		# Buslogic/Mylex MultiMaster SCSI adapters</p>
<p>#device		ncv		# NCR 53C500<br />
#device		nsp		# Workbit Ninja SCSI-3<br />
#device		stg		# TMC 18C30/18C50</p>
<p># SCSI peripherals<br />
device		scbus	# SCSI bus (required for SCSI)<br />
device		ch		# SCSI media changers<br />
device		da		# Direct Access (disks)<br />
device		sa		# Sequential Access (tape etc)<br />
device		cd		# CD<br />
device		pass		# Passthrough device (direct SCSI access)<br />
device		ses		# SCSI Environmental Services (and SAF-TE)</p>
<p># RAID controllers interfaced to the SCSI subsystem<br />
#device		amr		# AMI MegaRAID<br />
#device		asr		# DPT SmartRAID V, VI and Adaptec SCSI RAID<br />
#device		ciss		# Compaq Smart RAID 5*<br />
#device		dpt		# DPT Smartcache III, IV &#8211; See NOTES for options<br />
#device		hptmv		# Highpoint RocketRAID 182x<br />
#device		iir		# Intel Integrated RAID<br />
#device		ips		# IBM (Adaptec) ServeRAID<br />
#device		mly		# Mylex AcceleRAID/eXtremeRAID<br />
#device		twa		# 3ware 9000 series PATA/SATA RAID</p>
<p># RAID controllers<br />
#device		aac		# Adaptec FSA RAID<br />
#device		aacp		# SCSI passthrough for aac (requires CAM)<br />
#device		ida		# Compaq Smart RAID<br />
#device		mlx		# Mylex DAC960 family<br />
#device		pst		# Promise Supertrak SX6000<br />
#device		twe		# 3ware ATA RAID</p>
<p># atkbdc0 controls both the keyboard and the PS/2 mouse<br />
device		atkbdc	# AT keyboard controller<br />
device		atkbd	# AT keyboard<br />
#device		psm		# PS/2 mouse</p>
<p>device		vga		# VGA video card driver</p>
<p>#device		splash	# Splash screen and screen saver support</p>
<p># syscons is the default console driver, resembling an SCO console<br />
device		sc</p>
<p># Enable this for the pcvt (VT220 compatible) console driver<br />
#device		vt<br />
#options 	XSERVER		# support for X server on a vt console<br />
#options 	FAT_CURSOR	# start with block cursor</p>
<p>device		agp		# support several AGP chipsets</p>
<p># Floating point support &#8211; do not disable.<br />
device		npx</p>
<p># Power management support (see NOTES for more options)<br />
#device		apm<br />
# Add suspend/resume support for the i8254.<br />
device		pmtimer</p>
<p># PCCARD (PCMCIA) support<br />
# PCMCIA and cardbus bridge support<br />
#device		cbb		# cardbus (yenta) bridge<br />
#device		pccard		# PC Card (16-bit) bus<br />
#device		cardbus		# CardBus (32-bit) bus</p>
<p># Serial (COM) ports<br />
#device		sio		# 8250, 16[45]50 based serial ports</p>
<p># Parallel port<br />
#device		ppc<br />
#device		ppbus		# Parallel port bus (required)<br />
#device		lpt		# Printer<br />
#device		plip		# TCP/IP over parallel<br />
#device		ppi		# Parallel port interface device<br />
#device		vpo		# Requires scbus and da</p>
<p># If you&#8217;ve got a “dumb” serial or parallel PCI card that is<br />
# supported by the puc(4) glue driver, uncomment the following<br />
# line to enable it (connects to the sio and/or ppc drivers):<br />
#device         puc</p>
<p># PCI Ethernet NICs.<br />
#device		de		# DEC/Intel DC21x4x (“Tulip”)<br />
#device		em		# Intel PRO/1000 adapter Gigabit Ethernet Card<br />
#device		ixgb		# Intel PRO/10GbE Ethernet Card<br />
#device		txp		# 3Com 3cR990 (“Typhoon”)<br />
#device		vx		# 3Com 3c590, 3c595 (“Vortex”)</p>
<p># PCI Ethernet NICs that use the common MII bus controller code.<br />
# NOTE: Be sure to keep the &#8216;device miibus&#8217; line in order to use these NICs!<br />
device		miibus		# MII bus support<br />
#device		bfe		# Broadcom BCM440x 10/100 Ethernet<br />
#device		bge		# Broadcom BCM570xx Gigabit Ethernet<br />
#device		dc		# DEC/Intel 21143 and various workalikes<br />
device		fxp		# Intel EtherExpress PRO/100B (82557, 82558)<br />
#device		lge		# Level 1 LXT1001 gigabit ethernet<br />
#device		nge		# NatSemi DP83820 gigabit ethernet<br />
#device		pcn		# AMD Am79C97x PCI 10/100 (precedence over &#8216;lnc&#8217;)<br />
#device		re		# RealTek 8139C+/8169/8169S/8110S<br />
#device		rl		# RealTek 8129/8139<br />
#device		sf		# Adaptec AIC-6915 (“Starfire”)<br />
#device		sis		# Silicon Integrated Systems SiS 900/SiS 7016<br />
#device		sk		# SysKonnect SK-984x &amp; SK-982x gigabit Ethernet<br />
#device		ste		# Sundance ST201 (D-Link DFE-550TX)<br />
#device		ti		# Alteon Networks Tigon I/II gigabit Ethernet<br />
#device		tl		# Texas Instruments ThunderLAN<br />
#device		tx		# SMC EtherPower II (83c170 “EPIC”)<br />
#device		vge		# VIA VT612x gigabit ethernet<br />
#device		vr		# VIA Rhine, Rhine II<br />
#device		wb		# Winbond W89C840F<br />
#device		xl		# 3Com 3c90x (“Boomerang”, “Cyclone”)</p>
<p># ISA Ethernet NICs.  pccard NICs included.<br />
#device		cs		# Crystal Semiconductor CS89x0 NIC<br />
# &#8216;device ed&#8217; requires &#8216;device miibus&#8217;<br />
#device		ed		# NE[12]000, SMC Ultra, 3c503, DS8390 cards<br />
#device		ex		# Intel EtherExpress Pro/10 and Pro/10+<br />
#device		ep		# Etherlink III based cards<br />
#device		fe		# Fujitsu MB8696x based cards<br />
#device		ie		# EtherExpress 8/16, 3C507, StarLAN 10 etc.<br />
#device		lnc		# NE2100, NE32-VL Lance Ethernet cards<br />
#device		sn		# SMC&#8217;s 9000 series of Ethernet chips<br />
#device		xe		# Xircom pccard Ethernet</p>
<p># ISA devices that use the old ISA shims<br />
#device		le</p>
<p># Wireless NIC cards<br />
#device		wlan		# 802.11 support<br />
#device		an		# Aironet 4500/4800 802.11 wireless NICs.<br />
#device		awi		# BayStack 660 and others<br />
#device		wi		# WaveLAN/Intersil/Symbol 802.11 wireless NICs.<br />
#device		wl		# Older non 802.11 Wavelan wireless NIC.</p>
<p># Pseudo devices.<br />
device		loop		# Network loopback<br />
device		mem		# Memory and kernel memory devices<br />
device		io		# I/O device<br />
device		random		# Entropy device<br />
device		ether		# Ethernet support<br />
#device		sl		# Kernel SLIP<br />
#device		ppp		# Kernel PPP<br />
#device		tun		# Packet tunnel.<br />
device		pty		# Pseudo-ttys (telnet etc)<br />
#device		md		# Memory “disks”<br />
#device		gif		# IPv6 and IPv4 tunneling<br />
#device		faith		# IPv6-to-IPv4 relaying (translation)</p>
<p># The `bpf&#8217; device enables the Berkeley Packet Filter.<br />
# Be aware of the administrative consequences of enabling this!<br />
device		bpf		# Berkeley packet filter</p>
<p># USB support<br />
#device		uhci		# UHCI PCI-&gt;USB interface<br />
#device		ohci		# OHCI PCI-&gt;USB interface<br />
#device		usb		# USB Bus (required)<br />
#device		udbp		# USB Double Bulk Pipe devices<br />
#device		ugen		# Generic<br />
#device		uhid		# “Human Interface Devices”<br />
#device		ukbd		# Keyboard<br />
#device		ulpt		# Printer<br />
#device		umass		# Disks/Mass storage &#8211; Requires scbus and da<br />
#device		ums		# Mouse<br />
#device		urio		# Diamond Rio 500 MP3 player<br />
#device		uscanner	# Scanners<br />
# USB Ethernet, requires mii<br />
#device		aue		# ADMtek USB Ethernet<br />
#device		axe		# ASIX Electronics USB Ethernet<br />
#device		cue		# CATC USB Ethernet<br />
#device		kue		# Kawasaki LSI USB Ethernet<br />
#device		rue		# RealTek RTL8150 USB Ethernet</p>
<p># FireWire support<br />
#device		firewire	# FireWire bus code<br />
#device		sbp		# SCSI over FireWire (Requires scbus and da)<br />
#device		fwe		# Ethernet over FireWire (non-standard!)</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.secblog.cn/prima/798.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FreeBSD中Prima启动脚本位置</title>
		<link>http://www.secblog.cn/prima/796.html</link>
		<comments>http://www.secblog.cn/prima/796.html#comments</comments>
		<pubDate>Mon, 09 Aug 2010 05:26:41 +0000</pubDate>
		<dc:creator>豬頭濱</dc:creator>
				<category><![CDATA[Parallels]]></category>

		<guid isPermaLink="false">http://www.secblog.cn/?p=796</guid>
		<description><![CDATA[FreeBSD中自动启动服务的脚本目录在： /usr/local/etc/rc.d 具体说明如下： apache_ssl-prima.sh Apache 000.mysql-client.sh MySQL客户端 mysql-server.sh MySQL服务器 muddleftpd.sh FTP服务器 postfix.sh SMTP邮件收发服务 courier-pop3d.sh POP3邮件服务 bind9.sh DNS服务 020.jakarta-tomcat41.sh Tomcat JSP服务 resin.sh Resin JSP服务 acald.sh ACA 本地服务（只适用于主控+功能） acasd.sh ACA 远程服务（只适用于纯功能） 如要禁止某项服务，可以： chmod 600 /usr/local/etc/rc.d/courier-pop3d.sh 如要开启某项服务，可以： chmod 750 /usr/local/etc/rc.d/courier-pop3d.sh]]></description>
			<content:encoded><![CDATA[<p>FreeBSD中自动启动服务的脚本目录在：</p>
<p>/usr/local/etc/rc.d</p>
<p>具体说明如下：<br />
apache_ssl-prima.sh           Apache<br />
000.mysql-client.sh           MySQL客户端<br />
mysql-server.sh               MySQL服务器<br />
muddleftpd.sh                 FTP服务器<br />
postfix.sh                    SMTP邮件收发服务<br />
courier-pop3d.sh              POP3邮件服务<br />
bind9.sh                      DNS服务<br />
020.jakarta-tomcat41.sh       Tomcat JSP服务<br />
resin.sh                      Resin JSP服务<br />
acald.sh                      ACA 本地服务（只适用于主控+功能）<br />
acasd.sh                      ACA 远程服务（只适用于纯功能）</p>
<p>如要禁止某项服务，可以：<br />
chmod 600 /usr/local/etc/rc.d/courier-pop3d.sh</p>
<p>如要开启某项服务，可以：<br />
chmod 750 /usr/local/etc/rc.d/courier-pop3d.sh</p>
]]></content:encoded>
			<wfw:commentRss>http://www.secblog.cn/prima/796.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何更改主机名</title>
		<link>http://www.secblog.cn/prima/793.html</link>
		<comments>http://www.secblog.cn/prima/793.html#comments</comments>
		<pubDate>Mon, 09 Aug 2010 04:18:07 +0000</pubDate>
		<dc:creator>豬頭濱</dc:creator>
				<category><![CDATA[Parallels]]></category>

		<guid isPermaLink="false">http://www.secblog.cn/?p=793</guid>
		<description><![CDATA[假设要将主机名修改为NEW_HOSTNAME /etc/hosts /etc/sysconfig/network hostname NEW_HOSTNAME /etc/init.d/network reload]]></description>
			<content:encoded><![CDATA[<p>假设要将主机名修改为NEW_HOSTNAME<br />
/etc/hosts<br />
/etc/sysconfig/network<br />
hostname NEW_HOSTNAME<br />
/etc/init.d/network reload</p>
]]></content:encoded>
			<wfw:commentRss>http://www.secblog.cn/prima/793.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>为什么能看到用root身份而不是nobody身份执行的apache？</title>
		<link>http://www.secblog.cn/prima/791.html</link>
		<comments>http://www.secblog.cn/prima/791.html#comments</comments>
		<pubDate>Mon, 09 Aug 2010 04:16:42 +0000</pubDate>
		<dc:creator>豬頭濱</dc:creator>
				<category><![CDATA[Parallels]]></category>

		<guid isPermaLink="false">http://www.secblog.cn/?p=791</guid>
		<description><![CDATA[在linux的apache上，apache的启动身份是root 当使用root启动httpd进程后，httpd会在80端口做监听 当一个新的http请求到来的时候，以root启动的httpd进程会开启一个新的进程 这个新的进程将使用httpd.conf中指定的User和Group身份来启动 随后这个新的进程会提供网络服务 此时，如果中止了以root身份启动的那个httpd进程 则剩余的以nobody身份执行中的进程还会继续运行 但是无法启动更多的进程来满足服务需要了 所以，存在root身份启动的httpd进程是正常的，不是安全问题。 如下： [root@3.3.11Biz-41 ~]# ps aux &#124; grep httpd root 2784 0.0 0.5 10316 4204 ? Ss 09:33 0:00 /usr/sbin/httpd nobody 3500 0.0 0.5 10480 4424 ? S 11:00 0:00 /usr/sbin/httpd nobody 3501 0.0 0.5 10480 4440 ? S 11:00 0:00 /usr/sbin/httpd nobody 3502 0.0 0.5 10480 [...]]]></description>
			<content:encoded><![CDATA[<p>在linux的apache上，apache的启动身份是root<br />
当使用root启动httpd进程后，httpd会在80端口做监听<br />
当一个新的http请求到来的时候，以root启动的httpd进程会开启一个新的进程<br />
这个新的进程将使用httpd.conf中指定的User和Group身份来启动<br />
随后这个新的进程会提供网络服务<br />
此时，如果中止了以root身份启动的那个httpd进程<br />
则剩余的以nobody身份执行中的进程还会继续运行<br />
但是无法启动更多的进程来满足服务需要了</p>
<p>所以，存在root身份启动的httpd进程是正常的，不是安全问题。<br />
如下：</p>
<p>[root@3.3.11Biz-41 ~]# ps aux | grep httpd<br />
root      2784  0.0  0.5 10316 4204 ?        Ss   09:33   0:00 /usr/sbin/httpd<br />
nobody    3500  0.0  0.5 10480 4424 ?        S    11:00   0:00 /usr/sbin/httpd<br />
nobody    3501  0.0  0.5 10480 4440 ?        S    11:00   0:00 /usr/sbin/httpd<br />
nobody    3502  0.0  0.5 10480 4432 ?        S    11:00   0:00 /usr/sbin/httpd<br />
nobody    3503  0.0  0.5 10480 4432 ?        S    11:00   0:00 /usr/sbin/httpd<br />
nobody    3504  0.0  0.5 10480 4436 ?        S    11:00   0:00 /usr/sbin/httpd<br />
nobody    3505  0.0  0.5 10480 4432 ?        S    11:00   0:00 /usr/sbin/httpd<br />
nobody    3509  0.0  0.5 10480 4468 ?        S    11:00   0:00 /usr/sbin/httpd<br />
nobody    3558  0.0  0.5 10480 4432 ?        S    11:00   0:00 /usr/sbin/httpd<br />
nobody    4415  0.0  0.5 10480 4384 ?        S    17:10   0:00 /usr/sbin/httpd<br />
[root@3.3.11Biz-41 ~]#</p>
]]></content:encoded>
			<wfw:commentRss>http://www.secblog.cn/prima/791.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prima如何切换apache2的prefork和worker模式</title>
		<link>http://www.secblog.cn/prima/788.html</link>
		<comments>http://www.secblog.cn/prima/788.html#comments</comments>
		<pubDate>Mon, 09 Aug 2010 03:30:27 +0000</pubDate>
		<dc:creator>豬頭濱</dc:creator>
				<category><![CDATA[Parallels]]></category>

		<guid isPermaLink="false">http://www.secblog.cn/?p=788</guid>
		<description><![CDATA[在Prima/Plesk/Virtuozzo上，apache都使用了系统自带的httpd-2.0.5x的rpm包 在redhat linux上，默认使用的是prefork模式，而不是worker模式 如何在二者间切换？ 解决方案 Apache HTTP服务器被设计为一个强大的、灵活的能够在多种平台以及不同环境下工作的服务器。 不同的平台和不同的环境经常产生不同的需求，或是为了达到同样的最佳效果而采用不同的方法。 Apache凭借它的模块化设计很好的适应了大量不同的环境。 这一设计使得网站管理员能够在编译时和运行时凭借载入不同的模块来决定服务器的不同附加功能。 Apache2.0将这种模块化的设计延伸到了web服务器的基础功能上。 这个版本带有多路处理模块(MPM)的选择以处理网络端口绑定、 接受请求并指派子进程来处理这些请求。 比如，需要更好伸缩性的可以选择象worker或event这样线程化的MPM， 而需要更好的稳定性和兼容性以适应一些旧的软件可以用prefork 。 在Redhat Linux的主要版本as4上，apache版本为httpd-2.0.5x， 默认为prefork模式，主要是考虑到稳定性的原因。 要切换到worker模式，则需要登录到linux上，进行如下操作： 进入/usr/sbin目录 cd /usr/sbin 将当前的prefork模式启动文件改名 mv httpd httpd.prefork 将worker模式的启动文件改名 mv httpd.worker httpd 修改配置文件vi /etc/httpd/conf/httpd.conf 找到里边的如下一段，可适当修改负载等参数： &#60;IfModule worker.c&#62; StartServers 2 MaxClients 150 MinSpareThreads 25 MaxSpareThreads 75 ThreadsPerChild 25 MaxRequestsPerChild 0 &#60;/IfModule&#62; 重新启动服务 /etc/init.d/httpd restart 即可换成worker方式启动apache2 －－－－－－－－－－－－－－－－－－－－－－－－－－ 注意：处于稳定性和安全性考虑，不建议更换apache2的运行方式，使用系统默认prefork即可 [...]]]></description>
			<content:encoded><![CDATA[<p>在Prima/Plesk/Virtuozzo上，apache都使用了系统自带的httpd-2.0.5x的rpm包<br />
在redhat linux上，默认使用的是prefork模式，而不是worker模式<br />
如何在二者间切换？</p>
<table border="0" cellspacing="1" cellpadding="4" width="100%">
<tbody>
<tr>
<td>解决方案</td>
</tr>
<tr>
<td>Apache HTTP服务器被设计为一个强大的、灵活的能够在多种平台以及不同环境下工作的服务器。<br />
不同的平台和不同的环境经常产生不同的需求，或是为了达到同样的最佳效果而采用不同的方法。<br />
Apache凭借它的模块化设计很好的适应了大量不同的环境。<br />
这一设计使得网站管理员能够在编译时和运行时凭借载入不同的模块来决定服务器的不同附加功能。</p>
<p>Apache2.0将这种模块化的设计延伸到了web服务器的基础功能上。<br />
这个版本带有多路处理模块(MPM)的选择以处理网络端口绑定、<br />
接受请求并指派子进程来处理这些请求。<br />
比如，需要更好伸缩性的可以选择象worker或event这样线程化的MPM，<br />
而需要更好的稳定性和兼容性以适应一些旧的软件可以用prefork 。</p>
<p>在Redhat Linux的主要版本as4上，apache版本为httpd-2.0.5x，<br />
默认为prefork模式，主要是考虑到稳定性的原因。<br />
要切换到worker模式，则需要登录到linux上，进行如下操作：</p>
<p>进入/usr/sbin目录<br />
cd /usr/sbin</p>
<p>将当前的prefork模式启动文件改名<br />
mv httpd httpd.prefork</p>
<p>将worker模式的启动文件改名<br />
mv httpd.worker httpd</p>
<p>修改配置文件vi /etc/httpd/conf/httpd.conf<br />
找到里边的如下一段，可适当修改负载等参数：<br />
&lt;IfModule worker.c&gt;<br />
StartServers         2<br />
MaxClients         150<br />
MinSpareThreads     25<br />
MaxSpareThreads     75<br />
ThreadsPerChild     25<br />
MaxRequestsPerChild  0<br />
&lt;/IfModule&gt;</p>
<p>重新启动服务<br />
/etc/init.d/httpd restart</p>
<p>即可换成worker方式启动apache2</p>
<p>－－－－－－－－－－－－－－－－－－－－－－－－－－</p>
<p>注意：处于稳定性和安全性考虑，不建议更换apache2的运行方式，使用系统默认prefork即可<br />
另外很多php模块不能工作在worker模式下，例如redhat linux自带的php也不能支持线程安全<br />
所以最好不要切换工作模式。</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.secblog.cn/prima/788.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux系统日志不自动切分的问题</title>
		<link>http://www.secblog.cn/prima/782.html</link>
		<comments>http://www.secblog.cn/prima/782.html#comments</comments>
		<pubDate>Mon, 09 Aug 2010 03:27:07 +0000</pubDate>
		<dc:creator>豬頭濱</dc:creator>
				<category><![CDATA[Parallels]]></category>

		<guid isPermaLink="false">http://www.secblog.cn/?p=782</guid>
		<description><![CDATA[在/var/log下的日志，每7天将切分log，原有log命名为xxx.1，并且累积到一个月后自动删除。但是有的服务器不切分log。 解决方案 log切分是由 /etc/cron.daily/logrotate 完成的。他的配置文件是： /etc/logrotate.conf 其内容如下： &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; # see “man logrotate” for details # rotate log files weekly weekly # keep 4 weeks worth of backlogs rotate 4 # create new (empty) log files after rotating old ones create # uncomment this if you want your log files compressed #compress # RPM packages drop [...]]]></description>
			<content:encoded><![CDATA[<p>在/var/log下的日志，每7天将切分log，原有log命名为xxx.1，并且累积到一个月后自动删除。但是有的服务器不切分log。</p>
<table border="0" cellspacing="1" cellpadding="4" width="100%">
<tbody>
<tr>
<td>解决方案</td>
</tr>
<tr>
<td>log切分是由 /etc/cron.daily/logrotate 完成的。他的配置文件是：</p>
<p>/etc/logrotate.conf</p>
<p>其内容如下：</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
# see “man logrotate” for details<br />
# rotate log files weekly<br />
weekly</p>
<p># keep 4 weeks worth of backlogs<br />
rotate 4</p>
<p># create new (empty) log files after rotating old ones<br />
create</p>
<p># uncomment this if you want your log files compressed<br />
#compress</p>
<p># RPM packages drop log rotation information into this directory<br />
include /etc/logrotate.d</p>
<p># no packages own wtmp &#8212; we&#8217;ll rotate them here<br />
/var/log/wtmp {<br />
monthly<br />
create 0664 root utmp<br />
rotate 1<br />
}</p>
<p># system-specific logs may be also be configured here.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>这个文件指定了切分周期等参数。具体对每一个log的切分，是由/etc/logrotate.d目录下的脚本完成的。这个目录下包含apache、mysql、resin等若干服务的log文件。（邮件的/var/log/maillog是使用syslog写入系统的）</p>
<p>手工运行/etc/cron.daily/logrotate ，看报告什么错误。</p>
<p>例如报告<br />
error: httpd:1 duplicate log entry for /var/log/httpd/access_log</p>
<p>这是由于在/etc/logrotate.d目录下存在重复项目造成的。经检查用户自行安装了httpd的rpm，所以在etc/logrotate.d目录下存在apache和httpd两个目录切分项目，造成了logrotate程序运行失败。</p>
<p>解决方法：移出/etc/logrotate.d/httpd文件即可。推荐按照一台干净的服务器，检查是否有多余的log切分项目。</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.secblog.cn/prima/782.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何通过SSH协议，无需认证的使用SCP工具进行免认证的数据传输任务</title>
		<link>http://www.secblog.cn/prima/780.html</link>
		<comments>http://www.secblog.cn/prima/780.html#comments</comments>
		<pubDate>Mon, 09 Aug 2010 03:25:06 +0000</pubDate>
		<dc:creator>豬頭濱</dc:creator>
				<category><![CDATA[Parallels]]></category>

		<guid isPermaLink="false">http://www.secblog.cn/?p=780</guid>
		<description><![CDATA[如何通过SSH协议，无需认证的使用SCP工具进行免认证的数据传输任务？ 关键词：ssh 免认证 scp 数据传输 测试环境：local（192.168.0.1）-&#62; remote（192.168.0.2） 解决方案 如下给出一共六步的配置操作，适用于Linux系统环境。 step1 &#8211; 进入SSH协议存放root用户identity.pub和authorized_keys的文件目录 # cd /root/.ssh # ls -al 总数 18 drwxr-xr-x 2 root other 512 2月 24 14:35 . drwxr-xr-x 23 root other 1536 2月 16 17:14 .. -rw-r&#8211;r&#8211; 1 root other 678 2002 2月 24 authorized_keys -rw&#8212;&#8212;- 1 root other 3655 2月 24 14:08 [...]]]></description>
			<content:encoded><![CDATA[<p>如何通过SSH协议，无需认证的使用SCP工具进行免认证的数据传输任务？</p>
<p>关键词：ssh 免认证 scp 数据传输</p>
<p>测试环境：local（192.168.0.1）-&gt; remote（192.168.0.2）</p>
<table border="0" cellspacing="1" cellpadding="4" width="100%">
<tbody>
<tr>
<td>解决方案</td>
</tr>
<tr>
<td>如下给出一共六步的配置操作，适用于Linux系统环境。</p>
<p>step1 &#8211; 进入SSH协议存放root用户identity.pub和authorized_keys的文件目录</p>
<p># cd /root/.ssh<br />
# ls -al<br />
总数 18<br />
drwxr-xr-x   2 root     other        512  2月 24 14:35 .<br />
drwxr-xr-x  23 root     other       1536  2月 16 17:14 ..<br />
-rw-r&#8211;r&#8211;   1 root     other        678 2002   2月 24 authorized_keys<br />
-rw&#8212;&#8212;-   1 root     other       3655  2月 24 14:08 known_hosts<br />
-rw&#8212;&#8212;-   1 root     other        512  2月 24 14:35 random_seed</p>
<p>step2 &#8211; 使用SSH命令工具ssh-keygen生成公私钥</p>
<p># /usr/local/bin/ssh-keygen<br />
Generating 1024-bit dsa key pair<br />
6 Oo.oOoo.oOo.<br />
Key generated.<br />
1024-bit dsa, root@local, Tue Feb 24 2004 06:36:32<br />
Passphrase :<br />
Again      :<br />
Key is stored with NULL passphrase.<br />
(You can ignore the following warning if you are generating hostkeys.)<br />
This is not recommended.<br />
Don&#8217;t do this unless you know what you&#8217;re doing.<br />
If file system protections fail (someone can access the keyfile),<br />
or if the super-user is malicious, your key can be used without<br />
the deciphering effort.<br />
Private key saved to /root/.ssh2/id_dsa_1024_e<br />
Public key saved to /root/.ssh2/id_dsa_1024_e.pub<br />
# ls -al<br />
总数 18<br />
drwxr-xr-x   2 root     other        512  2月 24 14:35 .<br />
drwxr-xr-x  23 root     other       1536  2月 16 17:14 ..<br />
-rw-r&#8211;r&#8211;   1 root     other        678 2002   2月 24 authorized_keys<br />
-rw&#8212;&#8212;-   1 root     other       3655  2月 24 14:08 known_hosts<br />
-rw&#8212;&#8212;-   1 root     other        512  2月 24 14:35 random_seed</p>
<p>step3 &#8211; 使用SSH命令工具ssh-keygen1生成本机登录其他机器所需的authorized_key，默认存储于/root/.ssh/identity.pub文件</p>
<p># /usr/local/bin/ssh-keygen1<br />
Initializing random number generator&#8230;<br />
Generating p:  &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;++ (distance 268)<br />
Generating q:  &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..++ (distance 1312)<br />
Computing the keys&#8230;<br />
Testing the keys&#8230;<br />
Key generation complete.<br />
Enter file in which to save the key (/root/.ssh/identity):<br />
Enter passphrase:<br />
Enter the same passphrase again:<br />
Your identification has been saved in /root/.ssh/identity.<br />
Your public key is:<br />
1024 33 137759100819686934520696481763778829517032347151848709<br />
931347613191606803521634302106373663429062391373471487290158025<br />
105706619724046969007187994783371342003069780832585343903142348<br />
95784990163707656346620364648020005147382681862785569947494342<br />
0765419444885608631362197508294196811654926997336929202808042681631 root@local<br />
Your public key has been saved in /root/.ssh/identity.pub<br />
# ls -al<br />
总数 22<br />
drwxr-xr-x   2 root     other        512  2月 24 14:38 .<br />
drwxr-xr-x  23 root     other       1536  2月 16 17:14 ..<br />
-rw-r&#8211;r&#8211;   1 root     other        678 2002   2月 24 authorized_keys<br />
-rw&#8212;&#8212;-   1 root     other        533  2月 24 14:38 identity<br />
-rw-r&#8211;r&#8211;   1 root     other        337  2月 24 14:38 identity.pub<br />
-rw&#8212;&#8212;-   1 root     other       3655  2月 24 14:08 known_hosts<br />
-rw&#8212;&#8212;-   1 root     other        512  2月 24 14:38 random_seed<br />
# cat /root/.ssh/identity.pub<br />
1024 33 137759100819686934520696481763778829517032347151848709<br />
931347613191606803521634302106373663429062391373471487290158025<br />
105706619724046969007187994783371342003069780832585343903142348<br />
95784990163707656346620364648020005147382681862785569947494342<br />
0765419444885608631362197508294196811654926997336929202808042681631 root@local</p>
<p>step4 &#8211;  将identity.pub文件中的authorized_key内容原样拷贝到需要免SSH认证的对方机器上，位置为对方机器ssh协议存放root用 户identity.pub和authorized_keys的文件目录，要修改的文件为/root/.ssh/authorized_keys</p>
<p># ssh 192.168.0.2<br />
warning: Executing /usr/local/bin/ssh1 for ssh1 compatibility.<br />
root@192.168.0.2&#8242;s password:<br />
Warning: Remote host denied X11 forwarding, perhaps xauth program could not be run on the server side.<br />
Last login: Tue Feb 24 14:28:00 2004 from 192.168.8.252<br />
You have new mail.<br />
[root@remote root]#<br />
[root@remote root]# cd /root/.ssh<br />
[root@remote .ssh]# cat /root/.ssh/authorized_keys<br />
1024 37 1510957817385891963372652439207842737027918140859621507<br />
380729138329114441416521776984491500781874021566354104804727884<br />
519240069872528441273975697342453100667500263238390614807313900<br />
317593282635376291882684337383945048992455560162257982416115871<br />
07142667649373550013275351594257842948752831502084375880349649893 root@remote<br />
1024 33 137759100819686934520696481763778829517032347151848709<br />
931347613191606803521634302106373663429062391373471487290158025<br />
105706619724046969007187994783371342003069780832585343903142348<br />
95784990163707656346620364648020005147382681862785569947494342<br />
0765419444885608631362197508294196811654926997336929202808042681631 root@local<br />
[root@remote .ssh]# exit<br />
#</p>
<p>注意：在上述修改中，在remote(192.168.0.2)的/root/.ssh/authorized_keys添加了local(192.168.0.1)的/root/.ssh/identity.pub文件内容</p>
<p>step5 &#8211; 验证免SSH认证功能（using ssh from 192.168.0.1 to 192.168.0.2）<br />
# ssh 192.168.0.2<br />
warning: Executing /usr/local/bin/ssh1 for ssh1 compatibility.<br />
root@192.168.0.2&#8242;s password:<br />
Warning: Remote host denied X11 forwarding, perhaps xauth program could not be run on the server side.<br />
Last login: Tue Feb 24 14:28:00 2004 from 192.168.8.252<br />
You have new mail.<br />
[root@remote root]#</p>
<p>step6 &#8211; 典型应用场景：免认证的SCP数据传输测试（基于SSH免认证，通过SCP文件传输）<br />
local（192.168.0.1）-&gt;remote（192.168.0.2）</p>
<p>&#8212;<br />
L2 Tech Support<br />
SWsoft China</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.secblog.cn/prima/780.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>调整系统时间和时区的方法、同步时间的方法</title>
		<link>http://www.secblog.cn/prima/778.html</link>
		<comments>http://www.secblog.cn/prima/778.html#comments</comments>
		<pubDate>Mon, 09 Aug 2010 03:23:25 +0000</pubDate>
		<dc:creator>豬頭濱</dc:creator>
				<category><![CDATA[Parallels]]></category>

		<guid isPermaLink="false">http://www.secblog.cn/?p=778</guid>
		<description><![CDATA[Linux 方法： 1) 找到相应的时区文件 /usr/share/zoneinfo/Asia/Shanghai 用这个文件替换当前的/etc/localtime文件。 2) 修改/etc/sysconfig/clock文件，修改为： ZONE=”Asia/Shanghai” UTC=false ARC=false 3) 用修改系统时间为2004年6月4日10点45分，命令如下： date 060410452004 4) 同步BIOS时钟，命令如下： hwclock -w 5) 自动同步系统时间： /usr/bin/rdate -s time-a.nist.gov clock -w FreeBSD 方法： date YYMMDDHHMM 比如要修改时间为2007年9月6日10点52 date 0709061052 只改时间的话 date HHMM 使用NTP服务器更新本地时间 ntpdate time-a.nist.gov 常用的NTP服务器 time-a.nist.gov time.windows.com chime.utoronto.ca ntp.pipex.net]]></description>
			<content:encoded><![CDATA[<p>Linux 方法：<br />
1) 找到相应的时区文件 /usr/share/zoneinfo/Asia/Shanghai</p>
<p>用这个文件替换当前的/etc/localtime文件。</p>
<p>2) 修改/etc/sysconfig/clock文件，修改为：</p>
<p>ZONE=”Asia/Shanghai”<br />
UTC=false<br />
ARC=false</p>
<p>3) 用修改系统时间为2004年6月4日10点45分，命令如下：</p>
<p>date 060410452004</p>
<p>4) 同步BIOS时钟，命令如下：</p>
<p>hwclock -w</p>
<p>5) 自动同步系统时间：</p>
<p>/usr/bin/rdate -s time-a.nist.gov<br />
clock -w</p>
<p>FreeBSD 方法：<br />
date YYMMDDHHMM</p>
<p>比如要修改时间为2007年9月6日10点52<br />
date 0709061052</p>
<p>只改时间的话<br />
date HHMM</p>
<p>使用NTP服务器更新本地时间<br />
ntpdate time-a.nist.gov</p>
<p>常用的NTP服务器<br />
time-a.nist.gov<br />
time.windows.com<br />
chime.utoronto.ca<br />
ntp.pipex.net</p>
]]></content:encoded>
			<wfw:commentRss>http://www.secblog.cn/prima/778.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

