手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

ubuntu下开设FTP服务器完整教程

[日期:2007-08-15] 来源:Linux公社  作者:Linuxidc [字体: ]

apt-get install vsftpd

或者

apt-get install proftpd

或者

apt-get install pureftpd

参考下文:设置vsftpd

修改ip地址

编辑 /etc/network/interfaces 文件,用 sudo vi /etc/network/i

nterfaces,修改 IP 地址。

# This file describes the network interfaces available on your system

# and how to activate them. For more information, see interfaces(5).

# The loopback network interface

auto lo

iface lo inet loopback

# This is a list of hotpluggable network interfaces.

# They will be activated automatically by the hotplug subsystem.

mapping hotplug

        script grep

        map eth0

# The primary network interface

auto eth0

iface eth0 inet static

        address 202.38.??.??

        netmask 255.255.255.0

        network 202.38.??.??

        broadcast 202.38.??.??

        gateway 202.38.??.??

编辑 /etc/hosts 这个文件并且把新IP地址加进去,用 sudo vi /etc/hosts

127.0.0.1       localhost.localdomain   localhost       userftp

202.38.??.??   ???.ustc.edu.cn          userftp

# The following lines are desirable for IPv6 capable hosts

::1     ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

ff02::3 ip6-allhosts

编辑 /etc/hostname,内容改为 ???.ustc.edu.cn

/etc/init.d/networking restart 重新启动网络。

安装 SSH

apt-get install ssh openssh-server

现在可以通过其他电脑

ssh **@202.38.??.??

来远程管理服务器了。

安装vsftp

apt-get install vsftpd

配置/etc/vsftpd/vsftpd.conf

以下是我的vsftpd.conf内容

===============================================================

#服务器以standalong模式运行,这样可以进行下面的控制

listen=YES

#接受匿名用户

anonymous_enable=YES

#匿名用户login时不询问口令

no_anon_password=YES

# 接受本地用户

local_enable=YES

# 可以上传(全局控制).若想要匿名用户也可上传则需要设置anon_upload_enable=YES,

# 若想要匿名用户可以建立目录则需要设置anon_mkdir_write_enable=YES.这里禁止匿

# 名用户上传,所以不设置这两项.

write_enable=YES

#本地用户上传文件的umask

local_umask=022

#如果设为YES,匿名登入者会被允许上传目录的权限,当然,匿名使用者必须要有对

#上层目录的写入权。

anon_upload_enable=YES

#定义匿名登入的使用者名称。默认值为ftp

ftp_username=ftp

#如果设为YES,匿名登入者会被允许新增目录,当然,匿名使用者必须要有对上层

#目录的写入权。

anon_mkdir_write_enable=YES

# 为YES则进入目录时显示此目录下由message_file选项指定的文本文件(,默认为.messa

ge)的内容

dirmessage_enable=YES

#本地用户login后所在目录,若没有设置此项,则本地用户login后将在他的home目录

#(/etc/passwd的第六个字段)中.匿名用户的对应选项是anon_root

#local_root=/home

anon_root=/home/ftp/

# 使用上传/下载日志,日志文件默认为/var/log/vsftpd.log,可以通过xferlog_file选

项修改

xferlog_enable=YES

# Make sure PORT transfer connections originate from port 20 (ftp-data).

connect_from_port_20=YES

#日志使用标准xferlog格式

xferlog_std_format=YES

# You may change the default value for timing out a data connection.

data_connection_timeout=120

# 关闭本地用户chroot()

chroot_local_user=NO

linux
【内容导航】
第1页:ubuntu下开设FTP服务器完整教程 第2页:ubuntu下开设FTP服务器完整教程
相关资讯       Ubuntu  ftp服务器 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款