Chinaunix首页 | 论坛 | 博客
  • 博客访问: 168543
  • 博文数量: 13
  • 博客积分: 2510
  • 博客等级: 少校
  • 技术积分: 185
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-15 14:10
文章分类

全部博文(13)

文章存档

2008年(13)

我的朋友
最近访客

分类: LINUX

2008-11-13 12:20:08

November 28, 2007
wu-ftpd (http://gzcnc.onlinedown.net:81/down/wu-ftpd-current.tar.gz)
Rpm - ivh wu-ftpd-x.x.x-x.i386.rpm
apt-get install wu-ftpd
—————————————————
/etc/passwd: to setup the login folder
there are 6 files:

ftpAccess(main,for user authtication)
ftpconvertions(for compress/uncompress)
ftpgroups(set ftp group)
ftphosts(set rights for single user)
ftpservers(set diff IP/Domain Name for diff v-host)
ftpusers(to band users)

/etc/ftpaccess
class

# Class name typelist addresses
#class local real,guest,anonymous *.my.domain 192.168.0.0
#class remote real,guest,anonymous *
class all real,guest,anonymous *
##all users
class local real localhost loopback
classname local means just real users can connect from localhost
class remote guest,anonymous *
classname remote means guest and anonymous users can connect from everywhere
class rmtuser real !*.example.com
classname remote means real users can connect except example.com

deny 210.62.146.*:255.255.255.254 /etc/reject.msg
nice 20(max)
defumask[]
umask: the default rights for user created files
tcpwindow
keepalive TCP SO_KEEPALIVE
timeout accept –default 120 seconds
file-limit[][]: limit the download file numbers for class
file-limit out 20 lvfour: classname lvfour can download 20 files
byte-limit
limit-time{*anonymousguest}
limit-time guest 5: guest can only use for 5mins

————————————————————-
Example of /etc/ftpaccess:

class all real,guest,anonymous *
limit all 10 Any /etc/msgs/msg.dead
readme README* login
readme README* cwd=*
message /welcome.msg login
message .message cwd=*
compress yes all
tar yes all
log commands real
log transfers anonymous,real inbound,outbound
shutdown /etc/shutmsg
email user@hostname

———————————————————-
FTP Basic command:

[root@linux doc]# ftpcount
[root@linux doc]# ftpwho
[root@linux doc]# ftpshut [ -V ] [ -l min] [ -d min] time [ warning-message ... ]
-l 该选项设置在关闭FTP服务器以前多少分钟停止用户的连接请求
-d 该选项设置在关闭FTP服务器以前多少分钟将已经连接的用户断线
time 设置关闭FTP服务器的时间,例如希望在晚上10点关闭FTP服务器,则为2200
warning-message 断线以前显示给用户的告警信息
例如:
[root@linux /etc]# ftpshut -l15 -d5 1800 “ftp server will shutdown”
[root@lix /etc]# less shutmsg
2000 04 07 18 00 0015 0005
ftp server will shutdown

to create user who only can access server through ftp:

[root@ns /etc]#useradd ftp_user1
[root@ns /etc]#chmod 700 /etc/shadows
[root@ns /etc]#vi /etc/shadows

[root@linux /etc]# ftp [-p] [host|IP] [port]
-p :启动被动模式 (passive, PASV);
ftp> help <==提供更多的可用指令,可以常參考!
ftp> cd /pub <==變換目錄到 /pub 當中
ftp> dir <==顯示遠端主機的目錄內容
ftp> get file <==下載 file 這個檔案
ftp> mget file <==下載 file 這個目錄或檔案
ftp> put file <==上傳 file 這個檔案到伺服器上
ftp> delete file <==刪除主機上的 file 這個檔案
ftp> mkdir dir <==建立 dir 這個目錄
ftp> lcd /home <==切換『本地端主機』的工作目錄
ftp> passive <==啟動或關閉 passive 模式
ftp> binary <==資料傳輸模式設定為 binary 格式

续传命令
上传续传步骤:

在命令行使用ftp命令,第一次上传了文件的一半,意外断线需要续传。比如说文件file已经上传了12384字节.中断后:
$ftp
restart 12384
put file

下传续传步骤:

$reget remote-file [local-file]
如果local-file存在,则从上次传输中断处续传

———————

e vsftpd.conf
dirmessage_enable=YES
listen_port=2121
anonymous_enable=NO
#user can not change folder:
#Change
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd.chroot_list
#TO
chroot_list_enable=YES
# (default follows)
chroot_list_file=/etc/vsftpd/chroot_list
#each user has his own process:
setproctitle_enable=YES
local_enable=YES
ftpd_banner=Welcome to my ubuntu FTP service.
—————–
sudo gedit /etc/vsftpd.chroot_list
add two users:
xxd
user1

—————-
down/up load speed:
sudo gedit /etc/vsftpd/vsftpd.conf
#add below:
user_config_dir=/etc/userconf
#then
xxd@xxd-laptop: mkdir /etc/userconf

e /etc/userconf/xxd
local_max_rate=500000
e /etc/userconf/user1
local_max_rate=250000

—————
sudo /etc/init.d/vsftpd restart

阅读(663) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2009-03-07 18:29:18

DDD