2008年9月18日星期四

Linux:SSH实用技巧及常用命令使用说明

SFTP 可以使用的命令
CD 改变目录
LS 列出文件
MKDIR
RMDIR
PWD
CHGRP
CHOWN
CHMOD
LN OLDNAEM NEWNAME
RM PATH
RENAME OLDNAME NEWNAEM
EXIT 推出
LCD PATH 改变当前目录到本机目录
LLS
LMKDIR
LPWD L=LOCALHOST
PUT LOCALHOST_PATH HOST_PATH
PUT 本机目录或者文件
GET 远程主机目录文件 本机目录
GET 远程主机目录或者文件
GET *
GET *.RPM
# $OpenBSD: sshd_config,v 1.59 2002/09/25 11:17:16 markus Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.
#Port 22 SSH 默认的坚挺端口
#Protocol 2,1 选择SSH的版本
#ListenAddress 0.0.0.0 监听的IP地址
#ListenAddress ::
# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key SSH VERSION 1 使用的密钥
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key SSH VERSION 2 使用的RSA私钥
#HostKey /etc/ssh/ssh_host_dsa_key SSH VAESION 2 使用的 DSA私钥
# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 3600 版本一的密钥从新生成时间间隔
#ServerKeyBits 768 SERVER_KEY 的长度
# Logging
#obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH SSH登陆系统 记录信息 记录的位置 默认是/VAR/LOG/SECUER
SyslogFacility AUTHPRIV
#LogLevel INFO
# Authentication:
#UserLogin no 在SSH 下不接受LOGIN 程序登陆
#LoginGraceTime 120
#PermitRootLogin yes 是否让ROOT用户登陆
#StrictModes yes 用户的HOST_KEY 改面的时候不让登陆
#RSAAuthentication yes 是否使用纯的RAS认证 针对VERSION 1
#PubkeyAuthentication yes 是否使用PUBLIC_KEY 针对VERSION 2
#AuthorizedKeysFile .ssh/authorized_keys 使用不需要密码登陆的的帐号时帐号的存放文件所在的文件名
# rhosts authentication should not be used
#RhostsAuthentication no 本机系统不使用 RHOSTS 使用RHOSTS 不安全
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes 是否取消上面的认证方式 当然选是
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no 不使用针对 VERSION 1 使用RHOSTS 文件在/ETC/HOSTS.EQUIV 配合RAS进行认证 不建议使用
# similar for protocol version 2
#HostbasedAuthentication no 针对VERSION 2 也是上面的功能
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no 是否忽略主目录的 ~/.ssh/known_hosts文件记录
# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes 是否需要密码验证
#PermitEmptyPasswords no 是否允许空密码登陆
# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes 挑战任何密码验证
# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#AFSTokenPassing no
# Kerberos TGT Passing only works with the AFS kaserver
#KerberosTgtPassing no
# Set this to 'yes' to enable PAM keyboard-interactive authentication
# Warning: enabling this may bypass the setting of 'PasswordAuthentication'
#PAMAuthenticationViaKbdInt no
#X11Forwarding no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes 是否显示上次登陆信息
#PrintLastLog yes 显示上次登陆信息
#KeepAlive yes 发送连接信息
#UseLogin no
#UsePrivilegeSeparation yes 用户权限设置
#PermitUserEnvironment no
#Compression yes
#MaxStartups 10 连接的画面的设置 从连接就是登陆画面
# no default banner path
#Banner /some/path
#VerifyReverseMapping no
# override default of no subsystems
Subsystem sftp /usr/libexec/openssh/sftp-server
DenyUsers * 设置受阻的用户 代表全部用户
DenyUsers test
DenyGroups test
SSH 自动登陆设置
1设置CLIENT端建立PUBLIC_KEY 和 PRIVATE_KEY
[TEST@TEST TEST] SSH-KEYGEN –T RSA //-T 说明使用RSA 加密算法
生成密钥的文件夹 $HOME/.SSH/ID_RSA
上传PUBLIC_KEY 到SERVER
SFTP TEST@TEST
LCD /HOME/.SSH
PUT ID_RSA.PUB
EXIT
登陆到SERVER
执行命令
[TEST@TEST SSH] CAT ../ID_RSA.PUB >> AUTHORIZED_KEYS
相关的安全设置
/ETC/SSH/SSHD_CONFIG
/ETC/HOSTS.ALLOW
/ETC/HOSTS.DENY
IPTABLES
编辑/ETC/HOSTS.DENY
SSHD : ALL :SPAWN (/BIN/ECHO SECURITY NOTICE FROM HOST `/BIN/HOSTNAME` ;\
/BIN/ECHO ; /USR/SBIN/SAFE_FINGER @%H )\
/BIN/MAIL –S “%d -%H SECURITY” ROOT@LOCALHOST &\
:TWIST (/BIN/ECHO –E “\N\nWARNING connection not allowed. You attempt has been logged. \n\n\n 警告信息
来源:赛迪网

Snort 中文手册

摘要snort有三种工作模式:嗅探器、数据包记录器、网络入侵检测系统。嗅探器模式仅仅是从网络上读取数据包并作为连续不断的流显示在终端上。数据包记录器模式把数据包记录到硬盘上。网路入侵检测模式是最复杂的,而且是可配置的。我们可以让snort分析网络数据流以匹配用户定义的一些规则,并根据检测结果采取一定的动作。(2003-12-11 16:39:12)
Snort 用户手册

第一章 snort简介
snort有三种工作模式:嗅探器、数据包记录器、网络入侵检测系统。嗅探器模式仅仅是从网络上读取数据包并作为连续不断的流显示在终端上。数据包记录器模式把数据包记录到硬盘上。网路入侵检测模式是最复杂的,而且是可配置的。我们可以让snort分析网络数据流以匹配用户定义的一些规则,并根据检测结果采取一定的动作。
嗅探器
所谓的嗅探器模式就是snort从网络上读出数据包然后显示在你的控制台上。首先,我们从最基本的用法入手。如果你只要把TCP/IP包头信息打印在屏幕上,只需要输入下面的命令:
  ./snort -v
使用这个命令将使snort只输出IP和TCP/UDP/ICMP的包头信息。如果你要看到应用层的数据,可以使用:
  ./snort -vd
这条命令使snort在输出包头信息的同时显示包的数据信息。如果你还要显示数据链路层的信息,就使用下面的命令:
  ./snort -vde
注意这些选项开关还可以分开写或者任意结合在一块。例如:下面的命令就和上面最后的一条命令等价:
  ./snort -d -v –e
数据包记录器
如果要把所有的包记录到硬盘上,你需要指定一个日志目录,snort就会自动记录数据包:
  ./snort -dev -l ./log
当然,./log目录必须存在,否则snort就会报告错误信息并退出。当snort在这种模式下运行,它会记录所有看到的包将其放到一个目录中,这个目录以数据包目的主机的IP地址命名,例如:192.168.10.1
  如果你只指定了-l命令开关,而没有设置目录名,snort有时会使用远程主机的IP地址作为目录,有时会使用本地主机IP地址作为目录名。为了只对本地网络进行日志,你需要给出本地网络:
  ./snort -dev -l ./log -h 192.168.1.0/24
这个命令告诉snort把进入C类网络192.168.1的所有包的数据链路、TCP/IP以及应用层的数据记录到目录./log中。
如果你的网络速度很快,或者你想使日志更加紧凑以便以后的分析,那么应该使用二进制的日志文件格式。所谓的二进制日志文件格式就是tcpdump程序使用的格式。使用下面的命令可以把所有的包记录到一个单一的二进制文件中:
  ./snort -l ./log -b
注意此处的命令行和上面的有很大的不同。我们勿需指定本地网络,因为所有的东西都被记录到一个单一的文件。你也不必冗余模式或者使用-d、-e功能选项,因为数据包中的所有内容都会被记录到日志文件中。
你可以使用任何支持tcpdump二进制格式的嗅探器程序从这个文件中读出数据包,例如: tcpdump或者Ethereal。使用-r功能开关,也能使snort读出包的数据。snort在所有运行模式下都能够处理tcpdump格式的文件。例如:如果你想在嗅探器模式下把一个tcpdump格式的二进制文件中的包打印到屏幕上,可以输入下面的命令:
  ./snort -dv -r packet.log
在日志包和入侵检测模式下,通过BPF(BSD Packet Filter)接口,你可以使用许多方式维护日志文件中的数据。例如,你只想从日志文件中提取ICMP包,只需要输入下面的命令行:
  ./snort -dvr packet.log icmp

还有更多的.就看这里....http://man.chinaunix.net/network/snort/Snortman.htm

修改的postfix 邮件提示信息

我修改的postfix 邮件提示信息


自己胡乱修改的,注意标题不可以修改成中文
postfix的提示信息存储在/etc/postfix/bounce.cf
修改完成后,运行postconf -b /etc/postfix/bounce.cf重新加载,加载后会显示内容。看一下是否修改成功。
复制内容到剪贴板
代码:
#
# Do not edit this file. This file shows the default delivery status
# notification (DSN) messages that are built into Postfix.
#
# To change Postfix DSN messages, perhaps to add non-English text,
# follow instructions in the bounce(5) manual page.
#

#
# The failure template is used when mail is returned to the sender;
# either the destination rejected the message, or the destination
# could not be reached before the message expired in the queue.
#

failure_template = <<EOF
Charset: utf-8
From: MAILER-DAEMON (Mail Delivery System)
Subject: Undelivered Mail Returned to Sender
Postmaster-Subject: Postmaster Copy: Undelivered Mail

这里是 $myhostname 邮件服务器。
This is the mail system at host $myhostname.

很抱歉通知您,你的邮件无法投递到一个或者多个地址,

如果需要更多帮助,请将此邮件转发给邮件管理员。

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to <postmaster>

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The mail system
EOF


#
# The delay template is used when mail is delayed. Note a neat trick:
# the default template displays the delay_warning_time value as hours
# by appending the _hours suffix to the parameter name; it displays
# the maximal_queue_lifetime value as days by appending the _days
# suffix.
#
# Other suffixes are: _seconds, _minutes, _weeks. There are no other
# main.cf parameters that have this special behavior.
#
# You need to adjust these suffixes (and the surrounding text) if
# you have very different settings for these time parameters.
#

delay_template = <<EOF
Charset: utf-8
From: MAILER-DAEMON (Mail Delivery System)
Subject: Delayed Mail (still being retried)
Postmaster-Subject: Postmaster Warning: Delayed Mail

这里是 $myhostname 邮件服务器。
This is the mail system at host $myhostname.

####################################################################
# 这只是一条警告信息,你不需要再次发送你的邮件 #
# THIS IS A WARNING ONLY. YOU DO NOT NEED TO RESEND YOUR MESSAGE. #
####################################################################

你的邮件发送不成功,系统会在$maximal_queue_lifetime_days day(s)内每$delay_warning_time_hours hour(s)再次重新发送

如果需要更多帮助,请将此邮件转发给邮件管理员。
Your message could not be delivered for more than $delay_warning_time_hours hour(s).
It will be retried until it is $maximal_queue_lifetime_days day(s) old.

For further assistance, please send mail to <postmaster>

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The mail system
EOF


#
# The success template is used when mail is delivered to mailbox,
# when an alias or list is expanded, or when mail is delivered to a
# system that does not announce DSN support. It is an error to specify
# a Postmaster-Subject: here.
#

success_template = <<EOF
Charset: utf-8
From: MAILER-DAEMON (Mail Delivery System)
Subject: Successful Mail Delivery Report

这里是 $myhostname 邮件服务器。
This is the mail system at host $myhostname.

你的邮件已经成功投递到目标地址。
Your message was successfully delivered to the destination(s)
listed below. If the message was delivered to mailbox you will
receive no further notifications. Otherwise you may still receive
notifications of mail delivery errors from other systems.

The mail system
EOF


#
# The verify template is used for address verification (sendmail -bv
# address...). or for verbose mail delivery (sendmail -v address...).
# It is an error to specify a Postmaster-Subject: here.
#

verify_template = <<EOF
Charset: utf-8
From: MAILER-DAEMON (Mail Delivery System)
Subject: Mail Delivery Status Report

这里是 $myhostname 邮件服务器。
This is the mail system at host $myhostname.
你请求的邮件投递报告随此邮件附上。
Enclosed is the mail delivery report that you requested.

The mail system
EOF




来自:http://www.iredmail.org/bbs/viewthread.php?tid=84&pid=1171&page=1&extra=

看 Wietse 教你如何在 3 小时内投递 1000000 封邮件

从 ExtMail 论坛看到,然后去找了原文,希望对大家有帮助。

原文地址:
http://marc.info/?l=postfix-users&m=100153886212837&w=2
复制内容到剪贴板
代码:
List: postfix-users
Subject: Re: 1.000.000 email posted in a single delivery process
From: wietse () porcupine ! org (Wietse Venema)
Date: 2001-09-26 21:14:15
[Download message RAW]

If you want to deliver 1000000 queue files in 3 hours, that is 10
milliseconds per file. That seems a bit optimistic to me, considering
the latencies of real disks (every file needs to be read from disk,
the cache is cold) and of real networks (having a local DNS server
should really make a difference).

Neither qmail nor Postfix currently has connection caching, which
can make a difference sending mail to sites that have slow servers.

0 - In the /etc/syslog.conf file, put a - in front of the maillog
filename, so that the stupid syslogd does not hammer the disk
after writing each logfile record.

1 - The default settings of two levels of directory hashing in the
queue should suffice. If you disagree, change this with:

postconf -e hash_queue_depth=3
postfix reload

2 - Configure an adequate number of delivery agents in the master.cf
file: 500+. On your typical Linux box, this will run the kernel
out of resources and Postfix will slam on the brakes until you
fix it.

3 - Test the setup with the smtp-source and smtp-sink programs.
For the test, specify a relayhost name that points to the
smtp-sink program, and send messages with thousands of recipients
into Postfix, and have Postfix perform one-recipient deliveries.

On the Postfix host:

postconf -e relayhost=smtp-sink.host:9999 \
smtp_destination_recipient_limit=1

On the mail sink host (can be same as postfix host, if you have
enough memory and process slots and space for open files):

./smtp-sink -c :9999 1000

On the smtp-source host (can be same as postfix host):

./smtp-source -c -m 1000 -s 10 -r 10000 -t foo@postfix.host postfix.host

Postfix breaks up the deliveries into transactions of 1 recipient
each, so one message with 10000 recipients will keep lots of
delivery agents busy.

4 - Before submitting the real mail:

postconf -e defer_transports=smtp relayhost= \
smtp_destination_recipient_limit=\$default_destination_recipient_limit
postfix reload

(and don't let anyone execute a "sendmail -q" command).

5 - SUBMIT THE MAIL VIA SMTP, not via /usr/sbin/sendmail. Otherwise
you are throwing away all the performance.

6 - On Doomsday,

postconf -e defer_transports=
postfix reload
sendmail -q

7 - From here on, do not touch the box. Each time you stop or reload
Postfix, or do a sendmail -q, it slows down dramatically.

Wietse

Alexander:
> (I've posted this message in QMAIL and EXIM mailing list.
> Many people say me that POSTFIX can do a good work)
>
> This is a case study and it's NOT for create a spamming system or other
> terrible mail bombing system.
> I HATE them !
>
> Title: the best mode to deliver 1.000.000 email messages (recipient are ALL
> different and email are ALL different) in few hours during a single delivery
> session.
>
> You suppose to have a SMP Linux server (i.e. dual P-III 800 Mhz, 512 MB Ram,
> SCSI Raid 5, kernel 2.4.9 and RaiserFS) and a good internet connection (4
> Mbit/sec full bandwidth) and a fast DNS server near me.
>
> During the night a program running on the same server creates 1 million of
> email (getting user data and infos data from a SQL DB).
> This process need about 3 hours. Meanwhile email are created, they are
> "injected" in MTA queue (i.e. using qmail-inject or
> exim -odq -t) and they are NOT delivered: they stay in queue.
> The email are all different but short: about 800-1000 bytes each and the
> recipients are all different and are all remote.
> Yes, we can have a vary big number of different recipient domain but
> statistically we also have a large number of email directed on mass email
> system (Hotmail, Yahoo...)
>
> So 1.000.000 x 1.000 bytes = 1 GBytes data. Yes, like a technical
> information email system with personalized info for each recipient.
>
> Then every day at 8.00 AM the remote delivery needs to start (exim -q ,
> qmail-remote) and delivery is done once per day.
>
> Target: send 1 million of email in a very short time, shortest as possibile,
> it must end as soon as possibile. Bandwidth occupation is not a problem: we
> can use all 4 Mbit/sec (about 1 GB / 500 Kbytes/sec = about 2000 seconds , 1
> hour and few minutes. 2 or 3 hours are ok anyway).
>
> And now the questions:
>
> 1) QMAIL vs EXIM vs POSTFIX: which is the best MTA to manage 1.000.000 email
> in queue ?
> (EXIM with option "split_spool_directory" and QMAIL patched to have a more
> "deep" in queue tree, POSTIFIX ??)
>
> 2) EXIM can deliver all messages during a single SMTP session to the same
> email system (useful for mass system like HOTMAIL,YAHOO, ....), QMAIL no.
> Is it faster to have either for example 300 (more or less) qmail-remote
> process running and sending 1 messages each or for example 20 (more or
> less) "exim -q" process running sending more messages in a single SMTP
> connection ? Remember: the target is to use less time than possible.
>
> Thanks for any suggestion about.
> POSTFIX ,I've never used it, can be an alternative ?
>
>
>

-
To unsubscribe, send mail to majordomo@postfix.org with content
(not subject): unsubscribe postfix-users

来自:http://www.iredmail.org/bbs/viewthread.php?tid=76&pid=1170&page=1&extra=#pid1170

IRedMail-doc-MySQL-0.2

在这里帮忙为新的开发软件iRedMail做个堆广.也给自己留下一个笔记.好让自己想要找的时候可以找的更快.想复习的时候也可以再学习.

注意:本文档只适用于 iRedMail-0.2 版本。
如果您发现文档里有错误、不准确的地方,请您务必 联系我们,以便我们能尽快修正问题。感谢您的反馈。
Tutorial
iRedMail 安装要求
Overview
iRedMail 安装前的准备
建立 vmail 用户,作为所有邮件的拥有者
Apache 与 PHP
MySQL:存储邮件虚拟域和用户
Postfix:SMTP 服务
Dovecot:提供 POP3/IMAP 服务及 SASL 认证
Policyd:有效防止垃圾邮件
Amavisd-new:MTA 与 Anti-Spam,Anti-Virus 软件的桥梁
Roundcubemail:使用 AJAX 技术的 web mail 程序
phpMyAdmin:最好的 MySQL 数据库管理工具
PostfixAdmin:web 界面的虚拟域、虚拟用户管理程序
ClamAV:为邮件服务加上防病毒功能
SpamAssassin:为邮件服务加上基于邮件内容的发垃圾邮件功能
SPF: Sender Policy Framework
DKIM: DomainKeys Identified Mail
其它文档
Cyrus-SASL:为邮件服务提供用户验证功能
SquirrelMail:WebMail
参考文档
iRedMail 反垃圾邮件心得与总结
取自"http://www.iredmail.org/wiki/index.php?title=IRedMail-doc-MySQL-0.2&variant=zh-cn"

Red Hat Enterprise Linux AS 5 下载地址及安装号码

红帽子企业Linux 5安装序列号 Server:* Red Hat Enterprise Linux (Server including virtualization): 2515dd4e215225dd + Red Hat Enterprise Linux Virtualization Platform: 49af89414d147589 Client:* Red Hat Enterprise Linux Desktop: 660266e267419c67 + Red Hat Enterprise Linux Desktop + Workstation Option: da3122afdb7edd23 + Red Hat Enterprise Linux Desktop + Workstation + DualOS Option (Virtualization): 7fcc43557e9bbc42 + Red Hat Enterprise Linux Desktop + DualOS Option (Virtualization): fed67649ff918c77redhat linux as 5.0 正式DVD版的下载地址ftp://ftp.centoschina.com:2121/rhel.5.0.server.centoschina.com.dvd.iso
RHEL5 i386 FTP无限制全速下载!!!
不限速,不限流,不限线程,建议多线程下载!
ftp://60.232.126.152/os/linux/redhat/rhel5/rhel-5-server-i386-disc1.isoftp://60.232.126.152/os/linux/redhat/rhel5/rhel-5-server-i386-disc2.isoftp://60.232.126.152/os/linux/redhat/rhel5/rhel-5-server-i386-disc3.isoftp://60.232.126.152/os/linux/redhat/rhel5/rhel-5-server-i386-disc4.isoftp://60.232.126.152/os/linux/redhat/rhel5/rhel-5-server-i386-disc5.iso

2008年9月17日星期三

远程桌面连接--安装使用nomachine NX free edition.(不是freeNX)

这篇文章面对的读者是: 1.想由windows远程桌面连接ubuntu。 2.获得较VNC快和较安全的远程桌面。 3.使用过freenx,但是nxclient不能使用最新版,或有这样那样的问题。 4.能忍受nx free edition(不是freenx)的session只有两个的人。(freenx没有这个限制) 5.尝试了网上各种NX安装教程,而遇到问题的人。 如果你不是其中之一,请不要读下去。(如果不能解决问题,请参考参考文献,或google) 使用中的问题: windows Vista cpu使用100%,比较不爽。如果谁有解决方案,请告知 其它平台都不错。 由非linux平台连接到linux box有很多种方法。ubuntu本身就提供了XDMP,VNC,RDP等远程桌面登陆的方式。这些方式的实现比较简单,没有使用多少数据压缩的技术,因而远程时会感到比较慢,桌面图像的传送有滞后感。而linux的下一代远程桌面的方式,是nomachine公司提供的NX远程桌面技术。nx技术采取了新的远程协议,把x桌面的数据经过提取,仅传送一些参数,而且通过ssh来进行数据加密传送,因此相比VNC或直接XDMP具有很快的速度和较高的安全性能。 安装方法及问题解决: ------------------------------- 安装前的必要准备。 ------------------------------- 1.下载nomachine的NX free edition server client. Download "NX Desktop Server DEB for Linux" from: http://www.nomachine.com/select-package.php?os=linux&id=1 Download "NX Node DEB for Linux" from: http://www.nomachine.com/download-node.php?os=linux Download "NX Client DEB for Linux" from: http://www.nomachine.com/download-client-linux.php 请选择适合自己linux平台的安装包。 2.确保必要的依赖包存在。 在新立得管理器(Synaptic)里搜索以下软件包,确保它们已经被安装 libstdc++2.10-glibc2.2 openssh 3.如果你以前安装过FreeNX或者其它版本的NX,请先通过新立得卸载(用命令行也可以) 并移除相关的文件夹和残留文件。 ----------------------------------- 安装 ----------------------------------- 按以下的顺序安装下载的DEB文件(顺序很重要,nxserver依赖于前两个包的安装) nxclient nxnode nxserver 直接双击下载到的deb 文件安装即可。喜欢用命令行方式的可以cd到deb文件所在文件夹 或用命令: sudo dpkg -i file/path/filename.deb ----------------------- 配置 ----------------------- 这一步很重要,按网上的很多教程安装都没有说清楚,因此花了很多时间才搞定。 1.使用你喜欢的编辑器编辑 /etc/ssh/sshd_config 文件 比如: sudo vi /etc/ssh/sshd_config 添加一行: AuthorizedKeysFile /usr/NX/home/nx/.ssh/authorized_keys2 (注:如果原来有了AuthorizedKeysFile开头的这一行,很可能是因为之前安装过其他版本的NX,可以注释掉) 重启sshd: sudo /etc/init.d/ssh restart 确定nxserver已经能正常运行: sudo /usr/NX/bin/nxserver --status 如果得到信息如下,就是可以了 NX> 900 Connecting to server .. NX> 110 NX Server is running. NX> 999 Bye. 如果有错的话,应该是配置上的问题。到此nxserver安装完成。 --------------------------------- 更改nxserver配置文件 --------------------------------- sudo vi /usr/NX/etc/server.cfg 去掉以下两行的注释,并改为 ENABLE_AUTOKILL_SESSIONS = "1" ENABLE_UNENCRYPTED_SESSION = "0" 至于nxclient在windows上的安装和如何连接nxserver,网上教程大把请google知。 参考文献: 1. 主要参考,这篇讲的很细。 http://michigantelephone.mi.org/blog/2006/09/how-to-install-nx-server-and-client.html 2.nx的评论 http://www.linux.com/feature/116354 3.rpm方式安装,多图,不知什么语言的:) http://softvnn.com/forums/showthread.php?t=72138

来自:http://forum.ubuntu.org.cn/viewtopic.php?t=98089&start=0&postdays=0&postorder=asc&highlight=&sid=ec4dc116958f4e8a7fc564b15832a4c3

Oracle 10g RAC的安装和配置管理

BOracle RAC(Real Application Cluster)是构建大规模数据库系统的必要手段。做RAC实验需要两台以上的机器,还需要共享磁盘。多数网友不具备这个条件。本视频介绍了如何利用虚拟机技术,在一台机器上配置两个Linux虚拟机和共享磁盘,在这样的硬件基础上安装配置Oracle 10g RAC。本视频适合RAC的初学者。

Oracle 10g RAC的安装和配置管理[1/5] ==> 下载

Oracle 10g RAC的安装和配置管理[2/5] ==> 下载

Oracle 10g RAC的安装和配置管理[3/5] ==> 下载

Oracle 10g RAC的安装和配置管理[4/5] ==> 下载

Oracle 10g RAC的安装和配置管理[5/5] ==> 下载

来自:http://www.boobooke.com/html/10/0/29/1.htm

在RHEL4中配置vsftpd服务

一、 vsftpd服务器的安装和基本配置
1. 安装和启动
# cd /media/cdrom/RedHat/RPMS //进入安装目录
# rpm -ivh vsftpd-2.0.1-5.i386.rpm //安装vsftpd服务器软件(在第1第光盘中)
# service vsftpd start //启动vsftpd服务即可进行只读访问
# iptables –F //关闭防火墙
2. vsftpd的相关文件及位置
/etc/vsftpd/vsftpd.conf //vsftpd主配置文件
/etc/vsftpd.ftpuser /保存不允许进行ftp登录的本地用户帐号
/etc/init.d/vsftpd //vsftpd服务器的启动脚本
/var/ftp //匿名用户登录目录
/etc/vsftpd.user_list //与vsftpd.conf配合实现对vsftpd.user_list中指定帐号进行访问控制
包含的配置项
结果
userlist_enable=YES
vsftpd.user_list文件中的帐号被禁止进行FTP登录
userlist_deny=YES
userlist_enable=YES
只有vsftpd.user_list文件中的用户帐号能够进行FTP登录
userlist_deny=NO
3. vsftpd服务的简单应用
1) 允许匿名用户上传
# vi /etc/vsftpd/vsftpd.conf //编辑vsftpd主配置文件,去掉下列内容前面注释
anon_upload_enable=YES
anon_mkdir_write_enable=YES
# service vsftpd restart //重启vsftpd服务使设置生效
# cd /var/ftp/
# chmod 777 * //设置相应权限,以便用户可以上传
2) 将FTP本地用户禁锢在宿主目录中
# vi /etc/vsftpd/vsftpd.conf //编辑vsftpd主配置文件,添加如下配置行
chroot_local_user=YES //添加文档末尾即可
# service vsftpd restart //重启服务使设置生效
二、 配置FTP服务器的虚拟用户
1. 建立虚拟用户口令库文件
# vi /root/logins.txt //默认不存在,需手动建立, 奇数行表示虚拟用户名,偶数行设置用户口令
mike
123
john
123
2. 生成vsftpd的认证文件(在第3张光盘中)
# rpm -ivh db4-utils-4.2.52-7.1.i386.rpm
# db_load -T -t hash -f /root/logins.txt /etc/vsftpd/vsftpd_login.db //生成认证文件
# chmod 600 /etc/vsftpd/vsftpd_login.db //设置认证文件只对用户可读可写
3. 建立虚拟用户所需的PAM配置文件
# vi /etc/pam.d/vsftpd.vu //需手工建立,并添加如下内容
auth required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login
account required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login
4. 建立虚拟用户及要访问的目录并设置相应的权限
# useradd -d /home/ftpsite virtual //建立虚拟用户所需系统用户帐号,并指定宿主目录
# chmod 700 /home/ftpsite //设置该帐号宿主目录的权限为宿主可读可写
5. 设置vsftpd.conf配置文件
# vi /etc/vsftpd/vsftpd.conf //编辑配置文件,添加虚拟用户的配置内容如下
guest_enable=YES
guest_username=virtual
pam_service_name=vsftpd.vu
并去除下列一行关于禁固在宿主目录的选项
chroot_local_user=YES
# service vsftpd restart //重启vsftpd服务使设置生效
OK,虚拟用户可以进行登录了
6. 对虚拟用户设置不同的权限
# vi /etc/vsftpd/vsftpd.conf //设置主配置文件,添加用户配置文件目录设置如下
user_config_dir=/etc/vsftpd_user_conf
# mkdir /etc/vsftpd_user_conf //建立用户配置文件目录
# /etc/vsftpd_user_conf/mike
# /etc/vsftpd_user_conf/john //为虚拟用户建立单独的与用户名相同的配置文件
配置文件的内容及含义如下:
anon_world_readable_only=NO //表示用户可以浏览FTP目录和下载文件
anon_upload_enable=YES //表示用户可以上传文件
anon_mkdir_write_enable=YES //表示用户具有建立和删除目录的权限
anon_other_write_enable=YES //表示用户具有文件改名和删除文件的权限
# service vsftpd restart //重启vsftpd服务
三、 FTP服务器的资源限制
在vsftpd服务器中通过主配置文件vsftpd.conf中的以下选项对整体资源进行限制
max_clients=100 //允许最大的客户端连接数
max_per_ip=5 //同一IP最大客户端的连接数
local_max_rate=5000000 //设置本地用户最大传输数率(B/s)
anon_max_rate=2000000 //匿名用户最大的传输数率(B/s)

来自:http://hi.baidu.com/unarmy/blog/item/f5264c90c137f589a977a404.html

vsFTPd 安装与配置

vsFTPD是一款小巧易用FTP服务器程序,是一款在Linux发行版中最受推崇的FTP服务器程序,特点是小巧轻快,安全易用。
vsFTPd的安装
在最新的各大发行版中的安装盘中都有vsFTPd的软件包,用相应发行版提供的软件包管理工具就能安装。当然也可以到各大发行版的FTP镜像中找到vsftpd的软件包,用软件包的管理工具在线安装。推荐用发行版提供的软件来安装,不推荐自己编译源码包的安装方式。
Fedora 或Redhat 系统,可以用下面的命令在线安装;
[root@localhost ~]# yum install vsftpd
如果是debian 类系统,可以用apt 来在线安装;
[root@localhost ~]# apt-get install vsftpd
如果是RPM的系统,也可以找到vsftpd-xxxx.rpm 的包来通过rpm命令来安装;
[root@localhost ~]# rpm -ivh vsftpd*.rpm
下载源码包安装
[root@localhost ~]# tar zxvf vsftpd-2.0.3.tar.gz[root@localhost ~]# cd vsftpd-2.0.3[root@localhost ~]# make ;make install[root@localhost ~]# cp vsftpd.conf /etc
然后修改/etc/vsftpd.conf ,在配置文件的最后一行加入下面一行;
listen=yes
源码包安装的方法,如果您的系统是RPM包管理的系统,可以删除/etc/xinetd.d/vsftpd 这个文件;然后启动xinetd 服务器;
[root@localhost ~]# /etc/init.d/xinetd restart停止 xinetd: [ 确定 ]启动 xinetd: [ 确定 ]
vsFTPd服务器的运行
[root@localhost ~]# /usr/sbin/vsftpd &[root@localhost ~]# /usr/local/sbin/vsftpd &
vsFTPd 服务器关闭
用pkill vsftpd 来杀死vsftpd进程,这样就把vsFTPd关闭,用psgrep vsftpd 来查看进程,如果没有进程,证明vsFTPd已经关掉;要用到root权限。
[root@localhost ~]# pkill vsftpd[root@localhost ~]# pgrep vsftpd
在Fedora/Redhat/CentOS中vsFTPd 服务器的启动和关闭:
在Fedora/Redhat/CentOS中,也可以用下面的方法来启动vsFTPd;当然也要用到root权限;
[root@localhost beinan]# /etc/init.d/vsftpd start为 vsftpd 启动 vsftpd: [ 确定 ]
重新启动vsFTPd用下面的命令;
[root@localhost beinan]# /etc/init.d/vsftpd restart关闭 vsftpd: [ 确定 ]为 vsftpd 启动 vsftpd: [ 确定 ]
关掉vsFTPd服务器,应该用下面的命令;
[root@localhost beinan]# /etc/init.d/vsftpd stop关闭 vsftpd: [ 确定 ]
vsFTPd配置文件
vsftpd.conf是vsFTPd服务器的配置文件,此文件一般是/etc/vsftpd.conf或/etc/vsftpd/vsftpd.conf,vsftpd.conf配置文件就是vsFTPd服务器的全局控制文件,此配置文件中,每行应该算做一个规则。配置完后需要重启才有效。
vsFTPd配置虚拟用户
FTP用户一般是不能登录系统的,这也是为了安全。在系统中,没有权限登录系统的用户一般也被称之为虚拟用户;虚拟用户也是要写进/etc/passwd中;这只是一种虚拟用户的方法,但说实在的并不是真正的虚拟用户,只是把他登录SHELL的权限去掉了,所以他没有能力登录系统;
如果我们想把beinan这个用户目录定位在/opt/beinan这个目录中,并且不能登录系统;我们应该如下操作
[root@localhost ~]# adduser -d /opt/beinan -g ftp -s /sbin/nologin beinan[root@localhost ~]# passwd beinanChanging password for user beinan.New password:Retype new password:passwd: all authentication tokens updated successfully.[root@localhost ~]#
其实这还是不够的,还要改一下配置文件vsftpd.conf ,以确保本地虚拟用户能有读写权限;
local_enable=YESwrite_enable=YESlocal_umask=022
如何实现虚拟路径?
比如:
/home/a 映射为 ftp://localhost/a/home/b/c 则为 ftp://localhost/c
可以通过如下的方法来实现。
[root@localhost ~]# mount –bind [原有的目录] [新目录]
比如我的ftp的默认目录是/var/ftp,我想把/mnt/LinG/WinSoft文件夹,映射到/var/ftp目录中,我就如下操作
我们要先在/var/ftp目录中建一个目录
[root@localhost ~]# mkdir /var/ftp/WinSoft
然后执行mount命令
[root@localhost ~]# mount –bind /mnt/LinG/WinSoft /var/ftp/WinSoft
这样就OK了。
打开vsFTP服务器的日志功能
把下面xferlog_file前面的#号对掉,也就是把vsftp的log功能打开,这样我们就能在/var/log目录下查看vsftpd.log。这是vsFTP的日志功能,这对于我们来说是极为重要的。
xferlog_file=/var/log/vsftpd.log
如何让vsFTP服务器限制链接数,以及每个IP最大的链接数?
应该改vsFTPd服务器的配制文件vsftpd.conf,加入下面的两行:
max_clients=数字max_per_ip=数字
举例:我想让我的vsFTP最大支持链接数为100个,每个IP,最多能支持5个链接,所以我应该在vsftpd.conf中加上如下的两行:
max_clients=100max_per_ip=5
如何限制传输速度?
anon_max_rate=数字
注:这是匿名的速度
local_max_rate=数字
注:这是vsFTP服务器上本地用户的速度
注:这个数字的单位是byte,所以我们要计算一下。比如我想让匿名用户和vsFTP上的用户都以80KB下载,所以这个数字应该是1024×80=81920
所以我们要在vsftpd.conf中加入下面的两行
anon_max_rate=81920local_max_rate=81920
如何有选择的把用户限制在家目录中
我们要自己建一个文件,在/etc目录中
#touch /etc/vsftpd.chroot_list
以user1和user2这两个用户限制在他们所在的家目录中,而其它的FTP用户不做此限制。
在vsftpd.chroot_list这个文件中,把user1和user2添上去就行,注意,每个用户占一行。
然后改/etc/vsftpd/vsftpd.conf文件,找如下的两行
#chroot_list_enable=YES#chroot_list_file=/etc/vsftpd.chroot_list
把前面的#号去掉,也就是这样的
chroot_list_enable=YESchroot_list_file=/etc/vsftpd.chroot_list
如果没有这样的两行,就可以自己添加上去也是一样的。
设置好后,重新vsFTPD服务器。
如何把系统内所有的FTP用户都限制在家目录中呢?
我们可以通过更改vsftpd.conf文件,加入如下的一行
chroot_local_user=YES
改完配制文件,不要忘记重启vsFTPd服务器
[root@linuxsir001 root]# /etc/init.d/vsftpd restart关闭 vsftpd: [ 确定 ]为 vsftpd 启动 vsftpd: [ 确定 ][root@linuxsir001 root]#

来自:http://linux-os.cn/20070728/vsftpd/

安装vsftp出错:make: *** [sysdeputil.o] Error 1

gcc -c sysdeputil.c -O2 -Wall -W -Wshadow -idirafter dummyincsysdeputil.c:162: error: expected declaration specifiers or '...' before 'capset'sysdeputil.c:162: error: expected declaration specifiers or '...' before 'header'sysdeputil.c:162: error: expected declaration specifiers or '...' before 'data'In file included from sysdeputil.c:170:/usr/include/sys/sendfile.h: In function '_syscall2':/usr/include/sys/sendfile.h error: storage class specified for parameter 'sendfile'sysdeputil.c:186: error: storage class specified for parameter 'environ'sysdeputil.c:187: error: storage class specified for parameter 's_proctitle_space'sysdeputil.c:187: error: parameter 's_proctitle_space' is initializedsysdeputil.c:188: error: storage class specified for parameter 's_proctitle_inited'sysdeputil.c:188: error: parameter 's_proctitle_inited' is initializedsysdeputil.c:189: error: storage class specified for parameter 's_p_proctitle'sysdeputil.c:189: error: parameter 's_p_proctitle' is initializedsysdeputil.c:201: error: storage class specified for parameter 'do_sendfile'sysdeputil.c:202: error: storage class specified for parameter 'vsf_sysutil_setproctitle_internal'sysdeputil.c:203: error: storage class specified for parameter 's_proctitle_prefix_str'sysdeputil.c:278: error: storage class specified for parameter 's_pamh'sysdeputil.c:279: error: storage class specified for parameter 's_pword_str'sysdeputil.c:281: error: storage class specified for parameter 'pam_conv_func'sysdeputil.c:282: error: storage class specified for parameter 'vsf_auth_shutdown'sysdeputil.c:288: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' tokensysdeputil.c:383: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' tokensysdeputil.c:398: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' tokensysdeputil.c:436: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' tokensysdeputil.c:474: error: storage class specified for parameter 'do_checkcap'sysdeputil.c:478: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' tokensysdeputil.c:497: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' tokensysdeputil.c:514: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' tokensysdeputil.c:527: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' tokensysdeputil.c:604: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' tokensysdeputil.c:641: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' tokensysdeputil.c:796: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' tokensysdeputil.c:803: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' tokensysdeputil.c:809: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' tokensysdeputil.c:856: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' tokensysdeputil.c:889: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' tokensysdeputil.c:930: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' tokensysdeputil.c:935: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' tokensysdeputil.c:976: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' tokensysdeputil.c:1012: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' tokensysdeputil.c:1128: error: storage class specified for parameter 's_uwtmp_inserted'sysdeputil.c:1129: error: storage class specified for parameter 's_utent'sysdeputil.c:1134: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' tokensysdeputil.c:1173: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' tokensysdeputil.c:1189: error: old-style parameter declarations in prototyped function definitionsysdeputil.c:162: error: parameter name omittedsysdeputil.c:162: error: parameter name omittedsysdeputil.c:162: error: parameter name omittedsysdeputil.c:1189: error: expected '{' at end of inputmake: *** [sysdeputil.o] Error 1这几个包可能不是REDHAT的,这个问题的原因是sysdeputil.c 文件出错,真正解决方法是给其打补丁:

# patch sysdeputil.c attachment.bin

# makeattachment.bin 的位置在:

http://linuxfromscratch.org/pipermail/lfs-dev/attachments/20061019/fd9b9f56/attachment.bin

2008年9月16日星期二

假奶粉的反感

最近出现的乱子还真多。现在出现的奶粉都有病毒的。那些公司拿着国家发的免检牌。就真的认为他们生产出来的东西都乎合国家标准吗?这只是做一些表面的工作。企业做大了。当然什么都有了。想要什么样的结果都有呀。这还不是简单的说有了钱。什么都可以好说话。这次拿着免检牌。国家就不再去管理。这是大错特错了。因为他们生产出来的东西是特别的多。反而要大力度的查。
从这次的反映来看。说明我们国家对这些卫生管理检查还是不到位的。生产是生产/ 检查是检查。从三鹿婴幼儿奶粉说起。先是从这一家的出现问题后。检查力度加深了。分别查出更多的不合格产品。这说明卫生部门对这个管理有存在着很大的问题。现在觉的最不敢吃什么东西了。现在是奶粉。别的东西也同样会出现在卫生的检查问题上管理的不合格。看来现在东西不能吃的太多了。还是多吃点绿色食品。添加的有毒物质的变少。