Friday, August 27, 2010

FTP SERVER


Hello every one.



I installed it on my Linux machine and it's very

good to use. 





Please note that:

This installation guide only support OS Solaris10.



1.> put these two files(vsftpd, vsftpd.conf) to the directory which you create mannually;



su - root


# cd /opt

# mkdir vsftpd-2.0.5

........ ------ put these two files(vsftpd, vsftpd.conf) to vsftpd-2.0.5 directory.



# cd /opt/vsftpd-2.0.5

# chmod u+x *

# ls -l

total 488

-rwxr--r-- 1 root root 109908 Jun 8 20:54 vsftpd

-rwxr--r-- 1 root root 3913 Jun 8 20:56 vsftpd.conf





2.> We need create ftp user and directory for it.

# mkdir /var/ftp/

# useradd -d /var/ftp ftp

# chown root:root /var/ftp

# chmod 755 /var/ftp





3.> vsftpd needs the (empty) directory /usr/share/empty in the defaultconfiguration.

Add this directory in case it does not already exist.



# mkdir /usr/share/empty/





4.> vsftpd can run standalone or via an inetd (such as inetd or xinetd). This case we run vsftpd without inetd.



So we need edit /etc/vsftpd.conf, and add below line at the bottom:



listen=YES





5.> Copy vsftpd.conf to /etc , and edit it.



# cp vsftpd.conf /etc

# cd /etc/



# vi vsftpd.conf

Please notice below items for vsftp 's normal running when you edit vsftpd.conf.



......

# Allow anonymous FTP? (Beware - allowed by default if you comment this out).

anonymous_enable=YES

#

# Uncomment this to allow local users to log in.

local_enable=YES

#

# Uncomment this to enable any form of FTP write command.

write_enable=YES

#

# Default umask for local users is 077. You may wish to change this to 022,

# if your users expect that (022 is used by most other ftpd's)

local_umask=022

......

listen=YES ------ this is the last line of vsftpd.conf





6.> Test without an inetd



# mkdir /opt/vsftpd-2.0.5/GSN ------ Create directory for gsn user,

we also can create directory for rnc user follow gsn's steps

# useradd -d /opt/vsftpd-2.0.5/GSN gsn

# chown gsn : other GSN

# passwd gsn

New Password:

Re-enter new Password:

passwd: password successfully changed for gsn



#

# ls -lrt

total 490

-rwxr--r-- 1 root root 109908 Jun 8 20:54 vsftpd

-rwxr--r-- 1 root root 3913 Jun 8 20:56 vsftpd.conf

drwxr-xr-x 2 gsn other 512 Jun 8 21:44 GSN



/opt/vsftpd-2.0.5

# nohup ./vsftpd & ---- root user

# ps -ef|grep vsftpd

root 1301 1246 0 21:42:11 pts/1 0:00 grep vsftpd

root 1300 1246 0 21:42:06 pts/1 0:00 ./vsftpd







From Client side, we can get below information during we use vsftpd first time.



root@serverP}/opt/GSN# ftp 10.40.106.200

Connected to 10.40.106.200.

220 (vsFTPd 2.0.5)

Name (10.40.106.200:root): gsn

331 Please specify the password.

Password:

230 Login successful.

Remote system type is UNIX.

Using binary mode to transfer files.

ftp> pwd

257 "/opt/vsftpd-2.0.5/GSN"

ftp> dir

200 PORT command successful. Consider using PASV.

150 Here comes the directory listing.

226 Directory send OK.





7.>Construction startup script



# vi /etc/rc3.d/S83vsftpd



#!/sbin/sh

case "$1" in

start)

/usr/local/bin/vsftpd &

;;

stop)

pkill vsftpd

;;

*)

echo "Usage: $0 { start | stop }"

exit 1

;;

esac

exit 0







Best Regards.



2 comments: