Solaris FTP issue( 二 )


可以参考man手册

# ftpconfig -d /pub
Creating directory /pub
Updating directory /pub
#


Solaris 小于8 的 FTP log 设置



a: 创建ftp log文件
# touch /var/adm/ftpd.

b: 编辑inet服务配置文件
#vi /etc/inetd.conf.

# Ftp and telnet are standard Internet services.
ftp stream tcp nowait root /usr/sbin/in.ftpd in.ftpd
修改成:
ftp stream tcp nowait root /usr/sbin/in.ftpd in.ftpd -d -l

-d: 从syslogd得到 debug.info
-l: list 每一个FTP session


c: restart inetd daemons:

# ps -ef | grep inetd
root 14017 1 0 15:15:27 ? 0:01 /usr/sbin/inetd -s
# kill -1
#
note: -1 ,重新读取配置文件并初始化进程 , 等于 kill -HUP .



d: 修改syslogd.conf并从新启动
# vi /etc/syslog.conf


daemon.debug /var/adm/ftpd <<-----增加这一行

note: 中间用tab , 不能用空格 , 会出错的 。

# ps -ef | grep syslogd
root 14076 1 0 15:33:07 ? 0:08 /usr/sbin/syslogd
root 16039 16001 0 12:27:03 pts/5 0:00 /usr/bin/grep syslogd
# kill -1 【Solaris FTP issue】




f: 验证

# ps -ef | grep syslogd
root 14076 1 0 15:33:07 ? 0:08 /usr/sbin/syslogd


# fuser /var/adm/ftpd
/var/adm/ftpd: 14076o
#


自动get文件的教本~


#!/usr/bin/sh
# Change HOSTNAME, USER, PASSWD and FILENAME appropriately
# Do NOT include any comment lines between LABELs
# The only thing that can appear between LABELs are valid ftp commands
# the -n switch is necessary
/usr/bin/ftp -n << LABEL
open HOSTNAME
user USER PASSWD
binary
get FILENAME
bye
LABEL


自动获得多个文件的脚本 ~

#!/usr/bin/sh
# Change HOSTNAME, USER, and PASSWD appropriately. The mput *.HTML file could be anything (*.txt, file*, etc)
# Do NOT include any comment lines between LABELs
# The only thing that can appear between LABELs are valid ftp commands
# the -n switch is necessary. The -i switch turns off interactive prompting during multiple file transfers.
/usr/bin/ftp -in << LABEL
open HOSTNAME
user USER PASSWD
binary
mput *.html
bye
LABEL


如果有防火墙 , 那么需要用到rftp来自动获取文件 ~~

#!/usr/bin/sh
# Change HOSTNAME, USER, PASSWD and FILENAME appropriately
# Do NOT include any comment lines between LABELs
# The only thing that can appear between LABELs are valid ftp commands
# the -n switch is necessary
# rftp is a SOCKS clIEnt version of ftp. Happily provided at Sun in /usr/dist/exe.
# Do not know where rftp can be obtained but a man page is at:
# http://support.qnx.com/support/docs/qnx_neutrino/utilities/r/rftp.html
/usr/sbin/rftp -n << LABEL
open HOSTNAME
user USER PASSWD
binary
get FILENAME
bye
LABEL

推荐阅读