linux中ftp的配置管理

linux中ftp的配置管理,第1张

vsftpd是UNIX类 *** 作系统上运行的服务器名称,它的名字代表“very secure FTP daemon”,安全性是其设计与开发的一个重要目标。它可运行在Linux、Solaris等系统中,支持很多其他的FTP 服务器不支持的特征:

 非常高的安全性需求

 带宽限制

 良好的可伸缩性

 创建虚拟用户的可能性

 分配虚拟IP地址的可能性

一、vsftpd的启动

#service vsftpd start

如果允许用户匿名访问,需创建用户ftp和目录/var/ftp

# mkdir /var/ftp

# useradd –d /var/ftp ftp

二、vsftpd的配置

Vsftpd的配置文件存放在/etc/vsftpd/vsftpd.conf 我们可根据实际数要对如下信息进行配置:

1. 连接选项

☆监听地址和控制端口

(1) listen_address=ip address

定义主机在哪个IP 地址上监听FTP请求。即在哪个IP地址上提供FTP服务。

(2) listen_port=port_value

指定FTP服务器监听的端口号。默认值为21。

2. 性能与负载控制

☆超时选项

(1) idle_session_timeout=

空闲用户会话的超时时间,若是超过这段时间没有数据的传送或是指令的输入,则会被迫断线。默认值是300s

(2) accept_timeout=numerical value

接受建立联机的超时设定。默认值为60s

☆负载选项

(1) max_clients= numerical value

定义FTP服务器最大的兵法连接数。当超过此连接数时,服务器拒绝客户端连接。默认值为0,表示不限最大连接数。

(2) max_per_ip= numerical value

定义每个IP地址最大的并发连接数目。超过这个数目将会拒绝连接。此选项的设置将会影响到网际快车、迅雷之类的多线程下载软件。默认值为0,表示不限制。

(3) anon_max_rate=value

设定匿名用户的最大数据传输速度,以B/s为单位。默认无。

(4) local_max_rate=value

设定用户的最大数据传输速度。以B/s为单位。默认无。此选项对所有的用户都生效。

3. 用户选项

vsftpd的用户分为3类:匿名用户、本地用户(local user)及虚拟用户(guest)

☆ 匿名用户

(1) anonymous_enable=YES|NO

控制是否允许匿名用户登录

(2) ftp_username=

匿名用户使用的系统用户名。默认情况下,值为ftp

(3) no_anon_password= YES|NO

控制匿名用户登录时是否需要密码。

(4) anon_root=

设定匿名用户的根目录,即匿名用户登录后,被定位到此目录下。主配置文件中默认无此项,默认值为/var/ftp/

(5) anon_world_readable_only= YES|NO

控制是否只允许匿名用户下载可阅读的文档。YES,只允许匿名用户下载可阅读的文件。NO,允许匿名用户浏览整个服务器的文件系统。

(6) anon_upload_enable= YES|NO

控制是否允许匿名用户上传文件。除了这个参数外,匿名用户要能上传文件,还需要两个条件,write_enable参数为YES;在文件系统上,FTP匿名用户对某个目录有写权限。

(7) anon_mkdir_wirte_enable= YES|NO

控制是否允许匿名用户创建新目录。在文件系统上,FTP匿名用户必须对新目录的上层目录拥有写权限。

(8) anon_other_write_enbale= YES|NO

控制匿名用户是否拥有除了上传和新建目录之外的其他权限。如删除、更名等。

(9) chown_uploads= YES|NO

是否修改匿名用户所上传文件的所有权。YES,匿名用户上传得文件所有权改为另一个不同的用户所有,用户由chown_username参数指定。

(10) chown_username=whoever

指定拥有匿名用户上传文件所有权的用户。

☆本地用户

(1) local_enable= YES|NO

控制vsftpd所在的系统的用户是否可以登录vsftpd。

(2) local_root=

定义本地用户的根目录。当本地用户登录时,将被更换到此目录下。

☆虚拟用户

(1) guest_enable= YES|NO

启动此功能将所有匿名登入者都视为guest

(2) guest_username=

定义vsftpd的guest用户在系统中的用户名。

4. 安全措施

☆用户登录控制

(1) /etc/vsftpd.ftpusers

Vsftpd禁止列在此文件中的用户登录FTP服务器。此机制是默认设置的。

(2) userlist_enable= YES|NO

此选项激活后,vsftpd将读取userlist_file参数所指定的文件中的用户列表。

(3) userlist_file=/etc/vsftpd.user_list

指出userlist_enable选项生效后,被读取的包含用户列表的文件。默认值是/etc/vsftpd.user_list

(4) userlist_deny= YES|NO

决定禁止还是只允许由userlist_file指定文件中的用户登录FTP服务器。userlist_enable选项启动后才能生效。默认值为YES,禁止文中的用户登录,同时不向这些用户发出输入口令的指令。NO,只允许在文中的用户登录FTP服务器。

☆目录访问控制

(1) chroot_list_enable= YES|NO

锁定某些用户在自己的目录中,而不可以转到系统的其他目录。

(2) chroot_list_file=/etc/vsftpd/chroot_list

指定被锁定在主目录的用户的列表文件。

(3) chroot_local_users= YES|NO

将本地用户锁定在主目中。

三、vsftpd服务器的配置实例:

基于IP的虚拟FTP服务器配置

假设服务器有两个IP地址,192.168.1.199和192.168.1.200。vsftpd是建立在192.168.1.199上的。现在在192.168.1.200上再提供一个虚拟FTP服务器。

☆创建虚拟FTP服务器根目录

# mkdir –p /var/ftp2/pub

确保/var/ftp2和/var/ftp2/pub目录的所有者和组均为root,掩码为755

# chmod 755 /var/ftp2 # chmod 755 /var/ftp2/pub

# chown –R root /var/ftp2# chown –R : root /var/ftp2

☆ 增加虚拟FTP服务器的匿名用户帐号ftp2

# useradd –d /var/ftp2 –M ftp2

☆ 创建虚拟FTP服务器的配置文件

复制原来的vsftpd.conf作为虚拟FTP服务器的配置文件,并修改相关参数

# cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd2.conf

# vi /etc/vsftpd/vsftpd2.conf

添加或修改参数:

Listen=YES

Listen_address=192.168.1.200

ftp_username=ftp2

anon_root=/var/ftp2

并可参考vsftpd的配置部分的说明做其他配置,如:

•允许匿名用户上传文件

Write_enable=YES

Anon_world_readable_only=NO

Anon_upload_enable=YES

Anon_mkdir_write_enable=YES

创建匿名用户上传文件的目录,并设置权限:

# mkdir /var/ftp/incoming # chmod o+w /var/ftp/incoming

•取消写权限

Write_enable=NO

Anon_upload_enable=NO

Anon_mkdir_write_enable=NO

Anon_other_write_enable=NO

•限制下载速度为80KB/s

Anon_max_rate=8000

•控制并发数,以及每个IP地址的并发数

Max_clients=100

Max_per_ip=3

☆启动虚拟FTP服务器

# /usr/sbin/vsftpd /etc/vsftpd/vsftpd2.comf &

Linux (also known as GNU/Linux) is a Unix-like computer operating system. It is one of the most prominent examples of open source development and free softwareunlike proprietary operating systems such as Microsoft Windows or Mac OS X, its underlying source code is generally available for anyone to use, modify, and redistribute freely.

Initially, Linux was primarily developed and used by individual enthusiasts on personal computers. Since then, Linux has gained the support of major corporations such as IBM, Sun Microsystems, Hewlett-Packard, and Novell, Inc. for use in servers and is gaining popularity in the personal computer market.[1] It is used in systems ranging from supercomputers to mobile phones. Proponents and analysts attribute its success to its security, reliability,[2] low cost, and freedom from vendor lock-in.[3]

[edit]History

Image:Linus Torvalds.jpeg

Linus Torvalds, creator of the Linux kernel.In 1983, Richard Stallman founded the GNU Project, with the goal of developing a complete Unix-like operating system composed entirely of free software. By the beginning of the 1990s, GNU had produced or collected most of the necessary components of this system — libraries, compilers, text editors, a Unix shell — except for the core component, the kernel. The GNU project began developing a kernel, the GNU Hurd, in 1990, based on the Mach microkernel, but the development of this Mach-based design proved difficult and proceeded slowly.

Meanwhile, in 1991, another kernel was begun as a hobby by Finnish university student Linus Torvalds while attending the University of Helsinki.[4] Torvalds originally used Minix on his own computer, a simplified Unix-like system written by Andrew Tanenbaum for teaching operating system design. However, Tanenbaum did not permit others to extend his operating system, leading Torvalds to create a replacement for Minix.

Originally, Torvalds called his kernel "Freax" for "free" and "freak" and with the often-used X in the names of Unix-like systems. The name "Linux" was coined by Ari Lemmke, who administered an FTP server belonging to the Finnish University Networkhe invented the name Linux for the directory from which Torvalds' project was first available for download.[5]

Image:Unix.png

A graphic history of Unix systems. Linux is a Unix-type system but its source code does not descend from the original Unix.At first a computer running Minix was necessary in order to configure and install Linux. Initial versions of Linux also required another operating system to be present in order to boot from a hard disk, but soon there were independent boot loaders such as LILO. The Linux system quickly surpassed Minix in functionalityTorvalds and other early Linux kernel developers adapted their work for the GNU components and user-space programs to create a complete, fully functional, and free operating system.

Today, Torvalds continues to direct the development of the kernel, while other subsystems such as the GNU components continue to be developed separately (Linux kernel development is not part of the GNU Project). Other groups and companies combine and distribute these components with additional application software in the form of Linux distributions.

[edit]Portability

See also: Linux (kernel)

The Linux kernel was originally designed only for Intel 80386 microprocessors, but now supports a wide variety of computer architectures. Linux is one of the most widely ported operating systems, running on a diverse range of systems from the hand-held ARM-based iPAQ to the mainframe IBM System z9. Specialised distributions exist for less mainstream architectures.

[edit]Copyright, licensing, and the Linux trademark

The Linux kernel and most GNU software are licensed under the GNU General Public License. The GPL requires that all distributed source code modifications and derived works also be licensed under the GPL, and is sometimes referred to as a "share and share-alike" or "copyleft" license. In 1997, Linus Torvalds stated, "Making Linux GPL'd was definitely the best thing I ever did."[6] Other software may use other licensesmany libraries use the GNU Lesser General Public License (LGPL), a more permissive variant of the GPL, and the X Window System uses the MIT License.

In the United States, the name Linux is a trademark[7] registered to Linus Torvalds. Initially, nobody registered it, but on August 15, 1994, William R. Della Croce, Jr. filed for the trademark Linux, and then demanded royalties from Linux distributors. In 1996, Torvalds and some affected organizations sued to have the trademark assigned to Torvalds, and in 1997 the case was settled[8] . The licensing of the trademark is now handled by the Linux Mark Institute. Torvalds has stated that he only trademarked the name to prevent someone else from using it, but was bound in 2005 by United States trademark law to take active measures to enforce the trademark. As a result, the LMI sent out a number of letters to distribution vendors requesting that a fee be paid for the use of the name, and a number of companies have complied.[9]

[edit]Pronunciation

In 1992, Torvalds explained how he pronounces the word Linux:

“ 'li' is pronounced with a short [ee] sound: compare prInt, mInImal etc. 'nux' is also short, non-diphthong, like in pUt {IPA /ʊ/}. It's partly due to minix: linux was just my working name for the thing, and as I wrote it to replace minix on my system, the result is what it is... linus' minix became linux. „

— Linus Torvalds , comp.os.linux newsgroup[5]

An audio file of Torvalds saying "Hello, this is Linus Torvalds, and I pronounce Linux as Linux" can be found here. Note that in English, "Linux" and "Minix" are usually pronounced with a short i (IPA: /ɪ/) sound that is different from Torvalds' Finland-Swedish pronunciation of these words.

[edit]Linux and the GNU Project

Image:Richard Matthew Stallman.jpeg

Richard Stallman, founder of the GNU project for a free operating system.Main article: GNU/Linux naming controversy

The goal of the GNU project is to produce a Unix-compatible operating system consisting entirely of free software, and most general-purpose Linux distributions rely on GNU libraries and tools written to that effect. The Free Software Foundation views these Linux distributions as "variants" of the GNU system, and asks that such operating systems be referred to as GNU/Linux or a Linux-based GNU system. While some distributions make a point of using the combined form - notably Debian GNU/Linux - its use outside of the enthusiast community is limited, and Linus Torvalds has said that he finds calling Linux in general GNU/Linux "just ridiculous" [10] . The distinction between the Linux kernel and distributions based on it is a source of confusion to many newcomers, and the naming remains controversial.

[edit]SCO litigation

Main article: SCO-Linux controversies

In March 2003, the SCO Group filed a lawsuit against IBM, claiming that IBM had contributed portions of SCO's copyrighted code to the Linux kernel in violation of IBM's license to use Unix. Additionally, SCO sent letters to a number of companies warning that their use of Linux without a license from SCO may be actionable, and claimed in the press that they would be suing individual Linux users. This controversy has involved lawsuits by SCO against DaimlerChrysler (dismissed in 2004), and AutoZone, and by Red Hat and others against SCO. Furthermore, whether SCO even owns the relevant Unix copyrights is currently disputed by Novell.

As per the Utah District Court ruling on July 3, 2006182 claims out of 294 claims made by SCO against IBM have been dismissed.[11]

SCO's claims have varied widely. As of 2006, no proof of SCO's claims of copied code in Linux has been provided.

[edit]Development efforts

More Than a Gigabuck: Estimating GNU/Linux's Size, a 2001 study of Red Hat Linux 7.1, found that this distribution contained 30 million source lines of code.[12] Using the Constructive Cost Model, the study estimated that this distribution required about eight thousand man-years of development time. According to the study, if all this software had been developed by conventional proprietary means, it would have cost about 1.08 billion dollars (year 2000 U.S. dollars) to develop in the United States.

The majority of the code (71%) was written in the C programming language, but many other languages were used, including C++, Lisp, assembly language, Perl, Fortran, Python and various shell scripting languages. Slightly over half of all lines of code were licensed under the GPL. The Linux kernel was 2.4 million lines of code, or 8% of the total.

In a later study, Counting potatoes: The size of Debian 2.2, the same analysis was performed for Debian GNU/Linux version 2.2.[13] This distribution contained over fifty-five million source lines of code, and the study estimated that it would have cost 1.9 billion dollars (year 2000 U.S. dollars) to develop by conventional means.

[edit]Applications

Image:Linux-SuSE-KDE.png

A KDE desktop on the SUSE distribution.Linux has historically been used mainly as a server operating system, but its low cost, flexibility, and Unix background make it suitable for a wide range of applications. Linux is the cornerstone of the "LAMP" server-software combination (Linux, Apache, MySQL, Perl/PHP/Python) which has achieved popularity among developers, and which is one of the more common platforms for website hosting.

Due to its low cost and its high configurability, Linux is often used in embedded systems such as television set-top boxes, mobile phones, and handheld devices. Linux has become a major competitor to the proprietary Symbian OS found in many mobile phones, and it is an alternative to the dominant Windows CE and Palm OS operating systems on handheld devices. The popular TiVo digital video recorder uses a customized version of Linux. Several network firewall and router standalone products, including several from Linksys, use Linux internally, using its advanced firewalling and routing capabilities.

Linux is increasingly common as an operating system for supercomputers. In the November 2005 TOP500 list of supercomputers, the two fastest supercomputers in the world ran Linux. Of the 500 systems, 371 (74.2%) ran some version of Linux, including seven of the top ten.

The Sony PlayStation 3 video game console, scheduled to be released in November 2006, will run Linux by default. Sony has previously released a PS2 Linux do-it-yourself kit for their PlayStation 2 video game console. Game developers like Atari and id Software have released titles to the Linux desktop. Linux Game Publishing also produces games for Linux, licensing and porting them from their Windows source code.

The One Laptop Per Child project, which aims to provide computing devices to all children in developing nations, uses Linux as the devices' operating system.

[edit]Distributions

For more details on this topic, see Linux distribution.

Linux is predominantly used as part of a Linux distribution (commonly called a "distro"). These are compiled by individuals, loose-knit teams, and commercial and volunteer organizations. They commonly include additional system and application software, an installer system to ease initial system setup, and integrated management of software installation and upgrading. Distributions are created for many different purposes, including computer architecture support, localization to a specific region or language, real-time applications, and embedded systems, and many deliberately include only free software. Currently, over three hundred distributions are actively developed, with about a dozen distributions being most popular for general-purpose use.[14]

A typical general-purpose distribution includes the Linux kernel, some GNU libraries and tools, command-line shells, the graphical X Window System and an accompanying desktop environment such as KDE or GNOME, together with thousands of application software packages, from office suites to compilers, text editors, and scientific tools.

[edit]Desktop usage

Image:Gnome-2.14.png

A GNOME desktop running from the GNOME LiveCD.See also: Comparison of Windows and Linux

The high level of access granted to Linux's internals has led to Linux users traditionally tending to be more technologically oriented than users of Microsoft Windows and Mac OS, sometimes revelling in the tag of "hacker" or "geek". Linux and other free software projects have been frequently criticized for not going far enough to ensure ease of use.[citation needed]

This stereotype has begun to be dispelled in recent years. Linux may now be used with a user interface that is very similar to those running on other operating systems. Users may have to switch application software, and there are often fewer "known" options (as in the case of computer games) but there exist replacements for all general-purpose software, and general applications like spreadsheets, word processors, and browsers are available for Linux in profusion. Additionally, a growing number of proprietary software vendors are supporting Linux,[15] and compatibility layers such as the Wine system allow some Windows application software and drivers to be used on Linux without requiring the vendor to adapt them.

Linux's roots in the Unix operating system mean that while graphical configuration tools and control panels are available for many system settings and services, plain-text configuration files are still commonly used to configure the OS and may be exposed to users. In general, the command shell does not protect against accidents like file deletion, and the user interfaces of older programs are sometimes inconsistent.

The Berlin-based organization Relevantive concluded in 2003 that the usability of Linux for a set of desktop-related tasks was "nearly equal to Windows XP."[16] Since then, there have been numerous independent studies and articles which indicate that a modern Linux desktop using either GNOME or KDE is on par with Microsoft Windows in a business setting.[17]

[edit]Market share and uptake

Further information: Linux adoption

According to the market research company IDC, 25% of servers and 2.8% of desktop computers ran Linux as of 2004.[18]

The Linux market is rapidly growing and the revenue of servers, desktops, and packaged software running Linux is expected to exceed $35.7 billion by 2008.[19] The actual installed user base may be higher than indicated by this figure, as most Linux distributions and applications are freely available and redistributable.

The paper Why Open Source Software / Free Software (OSS/FS)? Look at the Numbers![20] identifies many quantitative studies of open source software, on topics including market share and reliability, with many studies specifically examining Linux.

[edit]Installation

The most common method of installing Linux on a personal computer is by booting from a CD-ROM that contains the installation program and installable software. Such a CD can be burned from a downloaded ISO image, purchased alone for a low price, can be obtained as part of a box set that may also include manuals and additional commercial software and in a few cases shipped for free by request. Mini CD images allow Linux to be installed from a disk with a small form factor.

As with servers, personal computers that come with Linux already installed are available from vendors including Hewlett-Packard and Dell, although generally only for their business desktop line.

Alternatives to traditional desktop installation include thin client installation, where the operating system is loaded and run from a centralised machine over a network connectionand running from a Live CD, where the computer boots the entire operating system from CD without first installing it on the computer's hard disk.

On embedded devices, Linux is typically held in the device's firmware and may or may not be consumer-accessible.

[edit]Programming on Linux

GNU Compiler Collection (GCC) is the de facto standard compiler for Linux. GCC provides frontends for C, [[C++]], Java and others. Most distributions also come installed with Perl, Python and other language interpreters, and several now include C# via the Mono project.

There are a number of Integrated development environments available including KDevelop, Anjuta, NetBeans, and Eclipse while the traditional editors Emacs and Vim remain popular.[citation needed]

The two main widget toolkits used for contemporary GUI programming are Qt and the Gimp Toolkit, known as [[GTK+]].

As well as these free and open source options, there are proprietary compilers and tools available from a range of companies such as Intel,[21] PathScale[22] and the Portland Group.[23]

[edit]Support

Technical support is provided by commercial suppliers and by other Linux users, usually in online forums, IRC, newsgroups, and mailing lists. Linux User Groups have traditionally been organized to provide support for Linux in specific cities and regions.

The business model of commercial suppliers is generally dependent on charging for support, especially for business users. A number of companies offer a specialized business version of their distribution, which adds proprietary support packages and tools to administer higher numbers of installations or to simplify administrative tasks.


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/6250569.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-19
下一篇 2023-03-19

发表评论

登录后才能评论

评论列表(0条)

保存