SUSE11:/ # cat /etc/SuSE-release
SUSE Linux Enterprise Server 11 (x86_64)
VERSION = 11
PATCHLEVEL = 0
SUSE11:/ # cat /etc/vsftpd.conf
# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# If you do not change anything here you will have a minimum setup for an
# anonymus FTP server.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
# General Settings
#
# Uncomment this to enable any form of FTP write command.
#
write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
#
dirmessage_enable=YES
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#
nopriv_user=ftpsecure
#
# You may fully customise the login banner string:
#
ftpd_banner="Welcome to FOOBAR FTP service."
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#
#ls_recurse_enable=YES
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#
#deny_email_enable=YES
#
# (default follows)
#
#banned_email_file=/etc/vsftpd.banned_emails
#
# If enabled, all user and group information in
# directory listings will be displayed as "ftp".
#
#hide_ids=YES
# Local FTP user Settings
#
# Uncomment this to allow local users to log in.
#
local_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
#
local_umask=022
#
# Uncomment to put local users in a chroot() jail in their home directory
# after login.
#
#chroot_local_user=YES
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
#
#chroot_list_enable=YES
#
# (default follows)
#
#chroot_list_file=/etc/vsftpd.chroot_list
#
# The maximum data transfer rate permitted, in bytes per second, for
# local authenticated users. The default is 0 (unlimited).
#
#local_max_rate=7200
# Anonymus FTP user Settings
#
# Allow anonymous FTP?
#
#anonymous_enable=YES
#
# Anonymous users will only be allowed to download files which are
# world readable.
#
#anon_world_readable_only=YES
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#
#anon_upload_enable=YES
#
# Default umask for anonymus users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
#
#anon_umask=022
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#
#anon_mkdir_write_enable=YES
#
# Uncomment this to enable anonymus FTP users to perform other write operations
# like deletion and renaming.
#
#anon_other_write_enable=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#
#chown_uploads=YES
#chown_username=whoever
#
# The maximum data transfer rate permitted, in bytes per second, for anonymous
# authenticated users. The default is 0 (unlimited).
#
#anon_max_rate=7200
# Log Settings
#
# Log to the syslog daemon instead of using an logfile.
#
#syslog_enable=YES
#
# Uncomment this to log all FTP requests and responses.
#
#log_ftp_protocol=YES
#
# Activate logging of uploads/downloads.
#
#xferlog_enable=YES
#
# You may override where the log file goes if you like. The default is shown
# below.
#
#vsftpd_log_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note: This disables the normal logging unless you enable dual_log_enable below.
#
#xferlog_std_format=YES
#
# You may override where the log file goes if you like. The default is shown
# below.
#
#xferlog_file=/var/log/xferlog
#
# Enable this to have booth logfiles. Standard xferlog and vsftpd's own style log.
#
#dual_log_enable=YES
#
# Uncomment this to enable session status information in the system process listing.
#
#setproctitle_enable=YES
# Transfer Settings
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
#
connect_from_port_20=YES
#
# You may change the default value for timing out an idle session.
#
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#
#data_connection_timeout=120
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that turning on ascii_download_enable enables malicious remote parties
# to consume your I/O resources, by issuing the command "SIZE /big/file" in
# ASCII mode.
# These ASCII options are split into upload and download because you may wish
# to enable ASCII uploads (to prevent uploaded scripts etc. from breaking),
# without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be
# on the client anyway..
#
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# Set to NO if you want to disallow the PASV method of obtaining a data
# connection.
#
#pasv_enable=NO
# PAM setting. Do NOT change this unless you know what you do!
#
pam_service_name=vsftpd
# Set listen=YES if you want vsftpd to run standalone
#
#listen=YES
# Set to ssl_enable=YES if you want to enable SSL
ssl_enable=NO
# Limit passive ports to this range to assis firewalling
pasv_min_port=30000
pasv_max_port=30100
2010年12月8日星期三
2010年12月7日星期二
通过scp备份Juniper ScreenOS防火墙配置
netscreen-> get system
Product Name: NetScreen-2000
Serial Number: 00XX0620060000XX, Control Number: 00000000
Hardware Version: 3010(0)-(04), FPGA checksum: 00000000, VLAN1 IP (0.0.0.0)
Software Version: 6.0.0r2.0, Type: Firewall+VPN
OS Loader Version: 1.1.5
Compiled by build_master at: Sat Jul 21 23:24:31 PDT 2007
Base Mac: 0010.dbbf.0c80
File Name: default (screenos_image), Checksum: 9b3bb5db
, Total Memory: 2048MB
先在ScreenOS设备启用SCP:
netscree->set scp enable
以下是一个 SCP 客户端命令的范例,该命令将配置文件从 NetScreen 设备 ( 管理员名称是 netscreen, IP 地址是
10.1.1.1 ) 的闪存中复制到客户端系统的ns_sys_config_backup文件中:
SuSe9:~ # scp netscreen@10.1.1.1:ns_sys_config ns_sys_config_bakcup
The authenticity of host '10.1.1.1 (10.1.1.1)' can't be established.
DSA key fingerprint is 5d:a3:00:47:ab:7d:12:2e:ac:d3:fe:85:ee:70:e6:4c.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.1.1.1' (DSA) to the list of known hosts.
netscreen@10.1.1.1's password:
ns_sys_config 100% 194KB 64.8KB/s 00:03
SuSe9:~ # ls -l ns_sys_config_bakcup-rw-r--r-- 1 root root 198913 2008-05-14 17:28 ns_sys_config_bakcup
netscreen-> get file flash:/$NSBOOT$.BIN 16880510
flash:/envar.rec 162
flash:/license.key 725
flash:/ns_sys_config 24318
flash:/prngseed.bin 32
flash:/policy.gz.v 14514
flash:/detector2.so 610255
Product Name: NetScreen-2000
Serial Number: 00XX0620060000XX, Control Number: 00000000
Hardware Version: 3010(0)-(04), FPGA checksum: 00000000, VLAN1 IP (0.0.0.0)
Software Version: 6.0.0r2.0, Type: Firewall+VPN
OS Loader Version: 1.1.5
Compiled by build_master at: Sat Jul 21 23:24:31 PDT 2007
Base Mac: 0010.dbbf.0c80
File Name: default (screenos_image), Checksum: 9b3bb5db
, Total Memory: 2048MB
先在ScreenOS设备启用SCP:
netscree->set scp enable
以下是一个 SCP 客户端命令的范例,该命令将配置文件从 NetScreen 设备 ( 管理员名称是 netscreen, IP 地址是
10.1.1.1 ) 的闪存中复制到客户端系统的ns_sys_config_backup文件中:
SuSe9:~ # scp netscreen@10.1.1.1:ns_sys_config ns_sys_config_bakcup
The authenticity of host '10.1.1.1 (10.1.1.1)' can't be established.
DSA key fingerprint is 5d:a3:00:47:ab:7d:12:2e:ac:d3:fe:85:ee:70:e6:4c.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.1.1.1' (DSA) to the list of known hosts.
netscreen@10.1.1.1's password:
ns_sys_config 100% 194KB 64.8KB/s 00:03
SuSe9:~ # ls -l ns_sys_config_bakcup-rw-r--r-- 1 root root 198913 2008-05-14 17:28 ns_sys_config_bakcup
netscreen-> get file flash:/$NSBOOT$.BIN 16880510
flash:/envar.rec 162
flash:/license.key 725
flash:/ns_sys_config 24318
flash:/prngseed.bin 32
flash:/policy.gz.v 14514
flash:/detector2.so 610255
Juniper NetScreen ScreenOS "Standard" Proposals
Phase-1:
加密:3DES
认证:SHA-1
Key Group:Diffie-Hellman Group 2
启用PFS和DH-Group2
----------------------------------------------------
Phase-2:
加密:3DES
认证:SHA-1
加密:3DES
认证:SHA-1
Key Group:Diffie-Hellman Group 2
启用PFS和DH-Group2
----------------------------------------------------
Phase-2:
加密:3DES
认证:SHA-1
NSR Log 出现“Hash Payload is incorrect”解决方法
故障现象如下:客户配置拨号VPN(Only IKE)无法连接到Netscreen Gateway(Juniper NetScreen ISG-1000),查看到NetScreen-Remote Log Viewer中日志:
Initiating IKE Phase 1 (IP ADDR=1.1.1.1)
SENDING>>>> ISAKMP OAK AG (SA, KE, NON, ID, VID, VID, VID, VID)
RECEIVED<<< ISAKMP OAK AG (SA, VID, VID, VID, KE, NON, ID, HASH, VID, NAT-D, NAT-D)
Peer is NAT-T capable
NAT is detected for Client
Hash Payload is incorrect #Hash 有效载荷错误My Connections\IKEUSER - SENDING>>>> ISAKMP OAK INFO (HASH, NOTIFY:INVALID_HASH_INFO)
My Connections\IKEUSER - Discarding IKE SA negotiation
MY COOKIE b6 23 af 2d f5 20 5c c1
HIS COOKIE eb 88 ee b9 87 b9 5d 72
RECEIVED<<< ISAKMP OAK AG (SA, VID, VID, VID, KE, NON, ID, HASH, VID, NAT-D, NAT-D)
Received message for non-active SA #从非活动SA收到信息
Juniper NetScreen ISG-1000上查看到相关日志:
system info 00536 Rejected an IKE packet on ethernet1/1
from 121.201.217.55:500 to
1.1.1.1:500 with cookies
6e341f52b69875ab and 6130c3fe4410810e
because the peer sent a packet with a
message ID before Phase 1
authentication was done. #...第一阶段认证未完成system info 00536 IKE<121.201.217.55> Phase 1: Responder
starts AGGRESSIVE mode negotiations.
表示NetScreen-Remote Client和NetScreen Gateway端的Preshare-key不匹配。
查看NetScreen Gateway端相应的ike gateway信息:
netscreen_isg1000-> get ike gateway ike_gateway
Id Name Gateway Address Gateway ID Mode Proposals
---- --------------- --------------- --------------- ---- ---------
1 ike_gateway ikeusergroup Aggr pre-g1-des-md5
Preshared Key: <***> Seed #表示共享密匙启用了Seed(种子)use count<0>, single-ike_tunnel<0>, status Enabled
user id<-1>, dial up id<6>
IP version 4
slot number<0>.
outgoing interface:
interface name = ethernet1/1, ip = 1.1.1.1, vsys = Root.
local-id type<2> value<DIALVPN>
peer-id empty.
peer-container-id empty.
IPsec NAT-Traversal: enabled.
keepalive frequency: 5 seconds.
UDP checksum: enabled.
local ike udp port 500.
peer ike udp port 500.
peer identity list:
0: NOT IAS
IAS ID 2f05c738
(0f) group <6> user <-1>
Phase 1 SA:
Phase 2 SA:session timeout: 0
Preferred Local Cert
--------------------
local cert not configured.
Preferred Peer Cert
-------------------
peer ca cert not configured.
Peer Cert Type
--------------
Preferred cert type: X509-SIG
Heartbeat Hello: 0(sec), Threshold: 5(times), Reconnect: 0(sec)
----------- XAUTH Config -------------
XAUTH disabled.
经询问客户,是在NetScreen-Remote Client上直接输入原始的Pre-share key,因为NetScreen Gateway端Pre-share key已启用seed,所以必须通过以下方法获得共享密匙:
netscreen_isg1000-> exec ike preshare-gen ike_gateway aikeuser #蓝色为网关名称,粉红色为用户名
preshared key for user <aikeuser> in peer <ike_gateway>:
<d91f418679 1afd720f0e 26d49623a7 7cb540bf46> #红色部分为共享密匙
Note: Spaces are for readability only.
把d91f418679 1afd720f0e 26d49623a7 7cb540bf46去掉空格后直接复制到NetScreen-Remote中按OK即可:
Initiating IKE Phase 1 (IP ADDR=1.1.1.1)
SENDING>>>> ISAKMP OAK AG (SA, KE, NON, ID, VID, VID, VID, VID)
RECEIVED<<< ISAKMP OAK AG (SA, VID, VID, VID, KE, NON, ID, HASH, VID, NAT-D, NAT-D)
Peer is NAT-T capable
NAT is detected for Client
Hash Payload is incorrect #Hash 有效载荷错误My Connections\IKEUSER - SENDING>>>> ISAKMP OAK INFO (HASH, NOTIFY:INVALID_HASH_INFO)
My Connections\IKEUSER - Discarding IKE SA negotiation
MY COOKIE b6 23 af 2d f5 20 5c c1
HIS COOKIE eb 88 ee b9 87 b9 5d 72
RECEIVED<<< ISAKMP OAK AG (SA, VID, VID, VID, KE, NON, ID, HASH, VID, NAT-D, NAT-D)
Received message for non-active SA #从非活动SA收到信息
Juniper NetScreen ISG-1000上查看到相关日志:
system info 00536 Rejected an IKE packet on ethernet1/1
from 121.201.217.55:500 to
1.1.1.1:500 with cookies
6e341f52b69875ab and 6130c3fe4410810e
because the peer sent a packet with a
message ID before Phase 1
authentication was done. #...第一阶段认证未完成system info 00536 IKE<121.201.217.55> Phase 1: Responder
starts AGGRESSIVE mode negotiations.
表示NetScreen-Remote Client和NetScreen Gateway端的Preshare-key不匹配。
查看NetScreen Gateway端相应的ike gateway信息:
netscreen_isg1000-> get ike gateway ike_gateway
Id Name Gateway Address Gateway ID Mode Proposals
---- --------------- --------------- --------------- ---- ---------
1 ike_gateway ikeusergroup Aggr pre-g1-des-md5
Preshared Key: <***> Seed #表示共享密匙启用了Seed(种子)use count<0>, single-ike_tunnel<0>, status Enabled
user id<-1>, dial up id<6>
IP version 4
slot number<0>.
outgoing interface:
interface name = ethernet1/1, ip = 1.1.1.1, vsys = Root.
local-id type<2> value<DIALVPN>
peer-id empty.
peer-container-id empty.
IPsec NAT-Traversal: enabled.
keepalive frequency: 5 seconds.
UDP checksum: enabled.
local ike udp port 500.
peer ike udp port 500.
peer identity list:
0: NOT IAS
IAS ID 2f05c738
(0f) group <6> user <-1>
Phase 1 SA:
Phase 2 SA:session timeout: 0
Preferred Local Cert
--------------------
local cert not configured.
Preferred Peer Cert
-------------------
peer ca cert not configured.
Peer Cert Type
--------------
Preferred cert type: X509-SIG
Heartbeat Hello: 0(sec), Threshold: 5(times), Reconnect: 0(sec)
----------- XAUTH Config -------------
XAUTH disabled.
经询问客户,是在NetScreen-Remote Client上直接输入原始的Pre-share key,因为NetScreen Gateway端Pre-share key已启用seed,所以必须通过以下方法获得共享密匙:
netscreen_isg1000-> exec ike preshare-gen ike_gateway aikeuser #蓝色为网关名称,粉红色为用户名
preshared key for user <aikeuser> in peer <ike_gateway>:
<d91f418679 1afd720f0e 26d49623a7 7cb540bf46> #红色部分为共享密匙
Note: Spaces are for readability only.
把d91f418679 1afd720f0e 26d49623a7 7cb540bf46去掉空格后直接复制到NetScreen-Remote中按OK即可:
SuSe Linux:ftp 500 OOPS: could not bind listening IPv4 socket
往一台Suse Linux 9 ftp文件时,发现报错:500 OOPS:could not bind listening IPv4 socket,如下所示:
SuSe9#ftp 10.10.10.10Connected to localhost.
500 OOPS: could not bind listening IPv4 socket
检查vsftpd状态,可知已启用,如下所示:
SuSe9#chkconfig --list vsftpd
xinetd based services:
vsftpd: on
Suse Linux vsftpd服务默认是在xinetd模式下运行,检查/etc/vsftpd.conf文件可发现,listen=YES前面的#号符已去掉,即开启vsftpd运行在standalone模式(见以下红色部分),以下为完整的vsftpd.conf文件配置:
SuSe9#cat vsftpd.conf
# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# If you do not change anything here you will have a minimum setup for an
# anonymus FTP server.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
# General Settings
#
# Uncomment this to enable any form of FTP write command.
#
write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
#
dirmessage_enable=YES
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#
#nopriv_user=ftpsecure
#
# You may fully customise the login banner string:
#
ftpd_banner="Welcome to FOOBAR FTP service."
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#
ls_recurse_enable=YES
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#
#deny_email_enable=YES
#
# (default follows)
#
#banned_email_file=/etc/vsftpd.banned_emails
#
# If enabled, all user and group information in
# directory listings will be displayed as "ftp".
#
#hide_ids=YES
# Local FTP user Settings
#
# Uncomment this to allow local users to log in.
#
local_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
#
local_umask=022
#
# Uncomment to put local users in a chroot() jail in their home directory
# after login.
#
#chroot_local_user=YES
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
#
chroot_list_enable=YES
#
# (default follows)
#
#chroot_list_file=/etc/vsftpd.chroot_list
#
# The maximum data transfer rate permitted, in bytes per second, for
# local authenticated users. The default is 0 (unlimited).
#
#local_max_rate=7200
# Anonymus FTP user Settings
#
# Allow anonymous FTP?
#
#anonymous_enable=YES
#
# Anonymous users will only be allowed to download files which are
# world readable.
#
#anon_world_readable_only=YES
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#
#anon_upload_enable=YES
#
# Default umask for anonymus users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
#
#anon_umask=022
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#
#anon_mkdir_write_enable=YES
#
# Uncomment this to enable anonymus FTP users to perform other write operations
# like deletion and renaming.
#
#anon_other_write_enable=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#
#chown_uploads=YES
#chown_username=whoever
#
# The maximum data transfer rate permitted, in bytes per second, for anonymous
# authenticated users. The default is 0 (unlimited).
#
#anon_max_rate=7200
# Log Settings
#
# Log to the syslog daemon instead of using an logfile.
#
syslog_enable=YES
#
# Uncomment this to log all FTP requests and responses.
#
log_ftp_protocol=YES
#
# Activate logging of uploads/downloads.
#
xferlog_enable=YES
#
# You may override where the log file goes if you like. The default is shown
# below.
#
vsftpd_log_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note: This disables the normal logging unless you enable dual_log_enable below.
#
xferlog_std_format=YES
#
# You may override where the log file goes if you like. The default is shown
# below.
#
xferlog_file=/var/log/xferlog
#
# Enable this to have booth logfiles. Standard xferlog and vsftpd's own style log.
#
dual_log_enable=YES
#
# Uncomment this to enable session status information in the system process listing.
#
#setproctitle_enable=YES
# Transfer Settings
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
#
connect_from_port_20=YES
#
# You may change the default value for timing out an idle session.
#
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#
#data_connection_timeout=120
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that turning on ascii_download_enable enables malicious remote parties
# to consume your I/O resources, by issuing the command "SIZE /big/file" in
# ASCII mode.
# These ASCII options are split into upload and download because you may wish
# to enable ASCII uploads (to prevent uploaded scripts etc. from breaking),
# without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be
# on the client anyway..
#
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# Set to NO if you want to disallow the PASV method of obtaining a data
# connection.
#
#pasv_enable=NO
# PAM setting. Do NOT change this unless you know what you do!
#
pam_service_name=vsftpd
# Set listen=YES if you want vsftpd to run standalone
#
listen=YES
把listen=YES关闭,即把“listen=YES”修改为“#listen=YES”后ftp恢复正常,如下所示:
Suse9#ftp 10.10.10.10 Connected to gdCMs2.
220 "Welcome to FOOBAR FTP service."
Name (10.10.10.10:root):
SuSe9#ftp 10.10.10.10Connected to localhost.
500 OOPS: could not bind listening IPv4 socket
检查vsftpd状态,可知已启用,如下所示:
SuSe9#chkconfig --list vsftpd
xinetd based services:
vsftpd: on
Suse Linux vsftpd服务默认是在xinetd模式下运行,检查/etc/vsftpd.conf文件可发现,listen=YES前面的#号符已去掉,即开启vsftpd运行在standalone模式(见以下红色部分),以下为完整的vsftpd.conf文件配置:
SuSe9#cat vsftpd.conf
# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# If you do not change anything here you will have a minimum setup for an
# anonymus FTP server.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
# General Settings
#
# Uncomment this to enable any form of FTP write command.
#
write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
#
dirmessage_enable=YES
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#
#nopriv_user=ftpsecure
#
# You may fully customise the login banner string:
#
ftpd_banner="Welcome to FOOBAR FTP service."
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#
ls_recurse_enable=YES
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#
#deny_email_enable=YES
#
# (default follows)
#
#banned_email_file=/etc/vsftpd.banned_emails
#
# If enabled, all user and group information in
# directory listings will be displayed as "ftp".
#
#hide_ids=YES
# Local FTP user Settings
#
# Uncomment this to allow local users to log in.
#
local_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
#
local_umask=022
#
# Uncomment to put local users in a chroot() jail in their home directory
# after login.
#
#chroot_local_user=YES
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
#
chroot_list_enable=YES
#
# (default follows)
#
#chroot_list_file=/etc/vsftpd.chroot_list
#
# The maximum data transfer rate permitted, in bytes per second, for
# local authenticated users. The default is 0 (unlimited).
#
#local_max_rate=7200
# Anonymus FTP user Settings
#
# Allow anonymous FTP?
#
#anonymous_enable=YES
#
# Anonymous users will only be allowed to download files which are
# world readable.
#
#anon_world_readable_only=YES
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#
#anon_upload_enable=YES
#
# Default umask for anonymus users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
#
#anon_umask=022
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#
#anon_mkdir_write_enable=YES
#
# Uncomment this to enable anonymus FTP users to perform other write operations
# like deletion and renaming.
#
#anon_other_write_enable=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#
#chown_uploads=YES
#chown_username=whoever
#
# The maximum data transfer rate permitted, in bytes per second, for anonymous
# authenticated users. The default is 0 (unlimited).
#
#anon_max_rate=7200
# Log Settings
#
# Log to the syslog daemon instead of using an logfile.
#
syslog_enable=YES
#
# Uncomment this to log all FTP requests and responses.
#
log_ftp_protocol=YES
#
# Activate logging of uploads/downloads.
#
xferlog_enable=YES
#
# You may override where the log file goes if you like. The default is shown
# below.
#
vsftpd_log_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note: This disables the normal logging unless you enable dual_log_enable below.
#
xferlog_std_format=YES
#
# You may override where the log file goes if you like. The default is shown
# below.
#
xferlog_file=/var/log/xferlog
#
# Enable this to have booth logfiles. Standard xferlog and vsftpd's own style log.
#
dual_log_enable=YES
#
# Uncomment this to enable session status information in the system process listing.
#
#setproctitle_enable=YES
# Transfer Settings
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
#
connect_from_port_20=YES
#
# You may change the default value for timing out an idle session.
#
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#
#data_connection_timeout=120
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that turning on ascii_download_enable enables malicious remote parties
# to consume your I/O resources, by issuing the command "SIZE /big/file" in
# ASCII mode.
# These ASCII options are split into upload and download because you may wish
# to enable ASCII uploads (to prevent uploaded scripts etc. from breaking),
# without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be
# on the client anyway..
#
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# Set to NO if you want to disallow the PASV method of obtaining a data
# connection.
#
#pasv_enable=NO
# PAM setting. Do NOT change this unless you know what you do!
#
pam_service_name=vsftpd
# Set listen=YES if you want vsftpd to run standalone
#
listen=YES
把listen=YES关闭,即把“listen=YES”修改为“#listen=YES”后ftp恢复正常,如下所示:
Suse9#ftp 10.10.10.10 Connected to gdCMs2.
220 "Welcome to FOOBAR FTP service."
Name (10.10.10.10:root):
2010年12月6日星期一
修改informix数据库服务监听端口
操作系统版本:
$ oslevel -r #本文中$代表以informix用户操作5100-02
数据库版本:
$ onstat -Informix Dynamic Server Version 9.40.FC1
环境描述:数据库主机有块网卡,分别连接不同的网段,如下所示:
$ ifconfig -aen0: flags=4e080863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,PSEG>
inet 192.168.1.135 netmask 0xffffffff broadcast 192.168.1.255
inet6 fe80::202:55ff:fe9a:d927/64
tcp_sendspace 131072 tcp_recvspace 65536
en2: flags=4e080863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,PSEG>
inet 172.16.1.228 netmask 0xfffffff0 broadcast 172.16.1.255
inet6 fe80::204:acff:fe57:7b45/64
目前informix数据库服务监听端口为1526,服务起在en2(172.16.1.228)网卡上,如下所示:
$ netstat -an | grep 1526Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 0 0 172.16.1.228.1526 *.* LISTEN
现要更改informix数据库服务监听端口为1435,服务起在en0(192.168.1.135)网卡上。步骤如下:
1、备份sqlhosts文件
$ cp $INFORMIXDIR/etc/sqlhosts $INFORMIXDIR/etc/sqlhosts.bak
2、修改sqlhost文件
首先查看sqlhosts文件内容:
$ cat $INFORMIXDIR/etc/sqlhosts
#**************************************************************************
#
# INFORMIX SOFTWARE, INC.
#
# PROPRIETARY DATA
#
# THIS DOCUMENT CONTAINS TRADE SECRET DATA WHICH IS THE PROPERTY OF
# INFORMIX SOFTWARE, INC. THIS DOCUMENT IS SUBMITTED TO RECIPIENT IN
# CONFIDENCE. INFORMATION CONTAINED HEREIN MAY NOT BE USED, COPIED OR
# DISCLOSED IN WHOLE OR IN PART EXCEPT AS PERMITTED BY WRITTEN AGREEMENT
# SIGNED BY AN OFFICER OF INFORMIX SOFTWARE, INC.
#
# THIS MATERIAL IS ALSO COPYRIGHTED AS AN UNPUBLISHED WORK UNDER
# SECTIONS 104 AND 408 OF TITLE 17 OF THE UNITED STATES CODE.
# UNAUTHORIZED USE, COPYING OR OTHER REPRODUCTION IS PROHIBITED BY LAW.
#
#
# Title: sqlhosts.demo
# Sccsid: @(#)sqlhosts.demo 9.2 7/15/93 15:20:45
# Description:
# Default sqlhosts file for running demos.
#
#**************************************************************************
dbcs onsoctcp 172.16.1.228 1526
编辑$INFORMIXDIR/etc/sqlhosts文件,把172.16.1.228修改为192.168.1.135,1526修改为1435,保存退出。
3、重启informix数据库
$ onmode -ky #关闭informix数据库
$ oninit -v #重启informix数据库
4、检查informix数据库服务监听端口
$ netstat -an | grep 1435Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 0 0 192.168.1.135.1435 *.* LISTEN
由上见知,informix数据库服务监听端口已成功修改为1435,服务启在en0(192.168.1.135)网卡上。
$ oslevel -r #本文中$代表以informix用户操作5100-02
数据库版本:
$ onstat -Informix Dynamic Server Version 9.40.FC1
环境描述:数据库主机有块网卡,分别连接不同的网段,如下所示:
$ ifconfig -aen0: flags=4e080863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,PSEG>
inet 192.168.1.135 netmask 0xffffffff broadcast 192.168.1.255
inet6 fe80::202:55ff:fe9a:d927/64
tcp_sendspace 131072 tcp_recvspace 65536
en2: flags=4e080863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,PSEG>
inet 172.16.1.228 netmask 0xfffffff0 broadcast 172.16.1.255
inet6 fe80::204:acff:fe57:7b45/64
目前informix数据库服务监听端口为1526,服务起在en2(172.16.1.228)网卡上,如下所示:
$ netstat -an | grep 1526Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 0 0 172.16.1.228.1526 *.* LISTEN
现要更改informix数据库服务监听端口为1435,服务起在en0(192.168.1.135)网卡上。步骤如下:
1、备份sqlhosts文件
$ cp $INFORMIXDIR/etc/sqlhosts $INFORMIXDIR/etc/sqlhosts.bak
2、修改sqlhost文件
首先查看sqlhosts文件内容:
$ cat $INFORMIXDIR/etc/sqlhosts
#**************************************************************************
#
# INFORMIX SOFTWARE, INC.
#
# PROPRIETARY DATA
#
# THIS DOCUMENT CONTAINS TRADE SECRET DATA WHICH IS THE PROPERTY OF
# INFORMIX SOFTWARE, INC. THIS DOCUMENT IS SUBMITTED TO RECIPIENT IN
# CONFIDENCE. INFORMATION CONTAINED HEREIN MAY NOT BE USED, COPIED OR
# DISCLOSED IN WHOLE OR IN PART EXCEPT AS PERMITTED BY WRITTEN AGREEMENT
# SIGNED BY AN OFFICER OF INFORMIX SOFTWARE, INC.
#
# THIS MATERIAL IS ALSO COPYRIGHTED AS AN UNPUBLISHED WORK UNDER
# SECTIONS 104 AND 408 OF TITLE 17 OF THE UNITED STATES CODE.
# UNAUTHORIZED USE, COPYING OR OTHER REPRODUCTION IS PROHIBITED BY LAW.
#
#
# Title: sqlhosts.demo
# Sccsid: @(#)sqlhosts.demo 9.2 7/15/93 15:20:45
# Description:
# Default sqlhosts file for running demos.
#
#**************************************************************************
dbcs onsoctcp 172.16.1.228 1526
编辑$INFORMIXDIR/etc/sqlhosts文件,把172.16.1.228修改为192.168.1.135,1526修改为1435,保存退出。
3、重启informix数据库
$ onmode -ky #关闭informix数据库
$ oninit -v #重启informix数据库
4、检查informix数据库服务监听端口
$ netstat -an | grep 1435Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 0 0 192.168.1.135.1435 *.* LISTEN
由上见知,informix数据库服务监听端口已成功修改为1435,服务启在en0(192.168.1.135)网卡上。
2010年12月4日星期六
linux/unix平台下sqlplus 按Backspace键删除时出现^H的处理方法
在linux/unix平台的sqplus中,输出字符后按Backspace键删除时,会出现^H,这对习惯了按Backspace键删除的用户来说,感觉非常别扭,虽然可以通过Ctrl+Backspace组合键实现删除功能。故障现象如下:

可通过stty命令修改终端配置来实现Backspace删除功能。如下:
[oracle@RHEL5 ~]$ id
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba),503(asadmin)
[oracle@RHEL5 ~]$ stty erase ^h
若要恢复Ctrl+Backspace组合键删除功能,可执行以下命令:
[oracle@RHEL5 ~]$ id
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba),503(asadmin)
[oracle@RHEL5 ~]$ stty erase ^?
同时可通过stty -a查看所有的终端设置:
[oracle@RHEL5 ~]$ id
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba),503(asadmin)
[oracle@RHEL5 ~]$ stty -aspeed 38400 baud; rows 42; columns 132; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S;
susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke
可通过stty命令修改终端配置来实现Backspace删除功能。如下:
[oracle@RHEL5 ~]$ id
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba),503(asadmin)
[oracle@RHEL5 ~]$ stty erase ^h
若要恢复Ctrl+Backspace组合键删除功能,可执行以下命令:
[oracle@RHEL5 ~]$ id
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba),503(asadmin)
[oracle@RHEL5 ~]$ stty erase ^?
同时可通过stty -a查看所有的终端设置:
[oracle@RHEL5 ~]$ id
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba),503(asadmin)
[oracle@RHEL5 ~]$ stty -aspeed 38400 baud; rows 42; columns 132; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S;
susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke
订阅:
博文 (Atom)