Detailed steps for VSFTPD Construction Under SOLARIS9

Source: Internet
Author: User
Tags ftp file gz file
Article Title: detailed steps for VSFTPD Construction Under SOLARIS9. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

INSTALL ====== This file details how to build and install/run vsftpd from the vsftpd distribution .tar.gz file. Gunzip * .tar.gz; Tar xvf *. tar;

Step 1) Build vsftpd. switch to the directory created when you unpacked the vsftpd .tar.gz file. e.g.: cd vsftpd-1.1.2 edit "builddefs. h "to handle compile-time settings (tcp_wrappers build, etc ).

Just type "make" (and mail me to fix it if it doesn' t build. this shoshould produce you a vsftpd binary. you can test for this, e.g.: [chris @ localhost vsftpd] $ ls-l vsftpd-rwxrwxr-x 1 chris 61748 Sep 27 vsftpd

Step 2) Satisfy vsftpd pre-requisites 2a) vsftpd needs the user "nobody" in the default configuration. add this user in case it does not already exist. e.g.: [root @ localhost root] # useradd nobody useradd: user nobody exists 2b) vsftpd needs the (empty) directory/usr/share/empty in the default configuration. add this directory in case it does not already exist. e.g.: [root @ localhost root] # mkdir/usr /Share/empty/mkdir: cannot create directory '/usr/share/empty': File exists 2c) For anonymous FTP, you will need the user "ftp" to exist, and have a valid home directory (which is NOT owned or writable by the user "ftp ". the following commands cocould be used to set up the user "ftp" if you do not have one: [root @ localhost root] # mkdir/var/ftp/[root @ localhost root] # useradd-d/var/ftp (the nex T two are useful to run even if the user "ftp" already exists ).

[Root @ localhost root] # chown root. root/var/ftp [root @ localhost root] # chmod og-w/var/ftp

Step 3) Install vsftpd config file, executable, man page, etc. running "make install" will try to copy the binary, man pages, etc. to somewhere sensible. or you might want to copy these things by hand, e.g.: install-m 755-c/usr/sbin // export/home/vsftp/vsftpd-2.0.1/vsftpd install vsftpd in the sbin directory; install-m 644-c/usr/local/man/man5/export/home/vsftp/vsftpd-2.0.1/vsftpd. conf.5 will vsftpd. install conf.5 in the man5 directory; install-m 644-c/usr/local/man/man8/export/home/vsftp/vsftpd-2.0.1/vsftpd.8 install vsftpd.8 in the man8 directory; "make install" doesn' t copy the sample config file. it is recommended you do this: install-m 755-c/etc/export/home/vsftp/vsftpd-2.0.1/vsftpd. conf sets vsftpd. conf is installed in the/etc directory;

Step 4) Smoke test (without an inetd ).

Vsftpd can run standalone or via an inetd (such as inetd or xinetd ). You will typically get more control running vsftpd from an inetd. but first we will run it without, so we can check things are going well so far. edit/etc/vsftpd. conf, and add this line at the bottom: listen = YES This tells vsftpd it will NOT be running from inetd. right, now let's try and run it!

Log in as root. Make sure you are not running other FTP servers (or vsftpd will not be able to use the FTP port, 21 ).

Run the binary from wherever you put it, e.g.: [root @ localhost root] #/usr/local/sbin/vsftpd & [1] 2104 If all is well, you can now connect! E.g.: [chris @ localhost chris] $ ftp localhost Connected to localhost (127.0.0.1 ).

220 (vsFTPd 1.1.1)

Name (localhost: chris): ftp 331 Please specify the password. password: 230 Login successful. have fun. remote system type is UNIX. using binary mode to transfer files. ftp> ls 227 Entering Passive Mode (229,133, 0)

150 Here comes the directory listing. d -- x 2 0 0 4096 Jan 14 2002 bin d -- x 2 0 0 4096 Apr 21 20:52 etc drwxr-xr-x 2 0 0 4096 Apr 21 lib drwxr-sr-x 2 0 50 4096 Jul 26 pub 226 Directory send OK. ftp>

Step 5) Run from an inetd of some kind (optional-standalone mode is now recommended)

You may want to run the binary from an inetd of some kind, because this can give you extra features-e.g. xinetd has a lot of settings. (Note that vsftpd's inbuilt listener covers most of the more useful xinetd settings ).

5a) If using standard "inetd", you will need to edit/etc/inetd. conf, and add a line such: ftp stream tcp nowait root/usr/sbin/tcpd/usr/local/sbin/vsftpd (Make sure to remove or comment out any existing ftp service lines. if you don't have tcp_wrappers installed, or don't want to use them, take out the/usr/sbin/tcpd part ).

Inetd will need to be told to reload its config file: kill-SIGHUP 'pidof inetd' 5b) If using "xinetd", you can follow a provided example, by looking at the file EXAMPLE/INTERNET_SITE/README. various other examples show how to leverage the more powerful xinetd features.

Step 6) Set up PAM for local logins (optional)

If you are running vsftpd on a PAM enabled machine, you will need to have a/etc/pam. d/ftp file present, otherwise non-anonymous logins will fail. [NOTE-if you have an older version of PAM, that file might be/etc/pam. conf] For a standard setup, you can just copy a provided example file: cp RedHat/vsftpd. pam/etc/pam. d/ftp

Step 7) Customize your configuration

As well as the above three pre-requisites, you are recommended to install a config file. the default location for the config file is/etc/vsftpd. conf. there is a sample vsftpd. conf in the distribution tarball. you probably want to copy that to/etc/vsftpd. conf as a basis for modification, I. e.: cp vsftpd. conf/etc The default configuration allows neither local user logins nor anonymous uploads. you may wish to change these ults.

Other notes ==============

Tested platforms (well, it builds)

-Any modern, well featured platform shocould work fine! Recent versions of the platforms listed below, and often older ones, shocould work fine.-RedHat Linux-RedHat Enterprise Linux-Solaris/GNU tools (Solaris 8 or newer)

-SuSE Linux-Debian Linux-OpenBSD-FreeBSD-NetBSD-HP-UX/GNU tools-IRIX/GNU tools-Mac OS X (note; older versions have setgroups () problem. 10.3.4 reported OK)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.