选择显示字体大小

solaris ftp issue


solaris 9 里面的ftp跟solaris 8 还是有一定差别的
原来放在/etc/default/目录里面,改成了在 /etc/ftpd/目录下了。

% ls -l
total 14
-rw-r--r-- 1 root sys 1518 may 28 00:46 ftpaccess
-rw-r--r-- 1 root sys 551 may 28 00:46 ftpconversions
-rw-r--r-- 1 root sys 104 may 28 00:46 ftpgroups
-rw-r--r-- 1 root sys 108 may 28 00:46 ftphosts
-rw-r--r-- 1 root sys 114 may 28 00:46 ftpservers
-rw-r--r-- 1 root sys 185 may 28 00:46 ftpusers

ftp 默认使用端口21,设置存在于文件/etc/services

% grep ftp services
ftp-data 20/tcp
ftp 21/tcp
tftp 69/udp



进程存在于 /etc/.netd.conf

% grep ftp .netd.conf
# ftp te.net shell login exec tftp finger printer
ftp stream tcp6 nowait root /usr/sbin/in.ftpd in.ftpd -a
# tftpd - tftp server (primarily used for booting)
#tftp dgram udp6 wait root /usr/sbin/in.tftpd in.tftpd -s /tftpboot



如果想要修改ftp的端口号,可以直接在/etc/.netd.conf修改
(不用额外修改/etc/services)

格式如下:

# vi /etc/.netd.conf
# ftpd - ftp server daemon
ftp stream tcp6 nowait root /usr/sbin/ftpd.sh in.ftpd -p 221



当然需要重新启动.netd

# ps -efgrep .netd
root 219 1 0 20:33:53 ? 0:01 /usr/sbin/.netd -s
root 597 596 1 23:28:44 pts/5 0:00 grep .netd
# kill -hup 219 <------- 219 pid of .netd


ftp session的时间设置:

# vi /etc/ftpd/ftpaccess

limit-time anonymous 30
limit-time guest 60

单位是分钟。


# ftp ftpserver
connected to ftpserver.
220 ftpserver ftp server ready.
name (ftpserver:user1): anonymous
331 guest login ok, send your complete e-mail address as password.
password:
230 guest login ok, access restrictions apply.
ftp> ls
200 port command successful.
150 opening ascii mode data connection for file list.
bin
dev
etc
pub
usr
226 transfer complete.
25 bytes received in 0.0029 seconds (8.50 kbytes/s)
ftp>

wait 30 minutes

ftp> ls
421 timeout (900 seconds): closing control connection.
ftp>



对real用户不起作用。


ftp mask设置

ftp> site umask 000

200 umask set to 000 (was 022)

ftp> mkdir testdir1

257 "/tmp/testdir1" new directory created.

ftp> dir

drwxrwxrwx 2 root other 117 jul 25 12:05 testdir1

ftp> site chmod 777 foo

200 chmod command successful.




在solaris 6 7 8 中用下面方式

# vi /etc/default/ftpd

umask=nnn


设置 ftp loging

1. 取消/etc/ftpd/ftpaccess 文件中下面这行的注释:

log commands real,guest,anonymous

2. 在/etc/syslog.conf 中添加:

daemon.info /var/log/ftplog

3. touch the file /var/log/ftplog

# touch /var/log/ftplog


4. 从新启动syslogd.

# kill -hup `pgrep syslogd`

5. 登陆并验证:

test # cat ftplog
nov 4 17:10:00.netlab11 ftpd[18885]: [id 165209 daemon.info] user root
nov 4 17:10:02.netlab11 ftpd[18885]: [id 125383 daemon.info] pass
password
nov 4 17:10:02.netlab11 ftpd[18885]: [id 539042 daemon.info] failed
login from kerouac.east.sun.com [129.148.192.158]
nov 4 17:10:04.netlab11 ftpd[18885]: [id 225560 daemon.info] quit
nov 4 17:10:10.netlab11 ftpd[18886]: [id 165209 daemon.info] user root
nov 4 17:10:11.netlab11 ftpd[18886]: [id 125383 daemon.info] pass
password


因为ftplog使用的是 debug.info (facility/level) , 如果syslog.conf文件前面已经有其他行使用了 debug.info,那么相应的ftplog就会被记录到那一行所对应的log文件中。
如:
*.err;kern.debug;daemon.notice;mail.crit;daemon.info /var/adm/messages


solaris 9 里面添加了wu-ftp,配置匿名ftp变得更加简单。
wu-ftp (sunwftpr, sunwftpu) 两个文件包。

执行 /usr/sbin/ftpconfig命令。
可以参考man手册

# ftpconfig -d /pub
creating directory /pub
updating directory /pub
#


solaris 小于8 的 ftp log 设置



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

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

# ftp and te.net are standard inte.net 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 .netd daemons:

# ps -ef grep .netd
root 14017 1 0 15:15:27 ? 0:01 /usr/sbin/.netd -s
# kill -1 <pid_.netd>
#
note: -1 ,重新读取配置文件并初始化进程,等于 kill -hup <pid of .netd>.



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 <pid-syslogd>




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

  


 


关键字 本文所属关键字

相关 与本文相关文章

分类 所有文章关键字导航

源码编程相关

Java   Asp   PHP   .Net   XML   C/C++   CGI   VB   Jsp   J2ee   J2se   J2me   EJB   Servlet   Tomcat   Resin   Struts   Weblogic   Eclipse   ANT   GUI   JMS   Web servise   IDEA   Webphere   Hibernate   Spring   Jboss   Applet   Swing   Socket   Javamail   Perl   Ajax   P2P   安全   模式   框架   测试   开源   游戏

SQL数据库相关

My-SQL   Ms-SQL   Access   DB2   Oracle   Sybase   SQLserver   索引   存储过程   加密   数据库   分页   视图  

手机无线相关

3G   Wap   CDMA   GRPS   GSM   IVR   彩信   短信   无线   增值业务

网页设计制作相关

HTML   CSS   网页配色   网页特效   Javascript   VBscript   Dreamweaver   Frontpage   JS   Web   网站设计

网站建设推广相关

建站经验   网站优化   网站排名   推广   Alexa

操作系统/服务器相关

Windows XP   Windows 2000   Windows 2003   Windows Me   Windows 9.x   Linux   UNIX   注册表   操作系统   服务器   应用服务器

图形图像多媒体相关

Photoshop   Fireworks   Flash   Coreldraw   Illustrator   Freehand   Photoimpact   多媒体   图形图像

标准 网站致力的规范

Valid CSS!

无不良内容,无不良广告,无恶意代码

Valid XHTML 1.0 Transitional

creativecommons