Very Secure File Transfer Protocol (VSFTP)
Description: It used to transfer files between server, we can upload and download files.
Server Installation and Configuration
Installation:
Method 1) Already yum server is configured.then following step
yum install vsftpd
Method 2) Manual installation using rpm:
step1:
mount iso
mount -t -iso9660 -o loop -v <ISO_file> <mount_point>
step2:
change to mounted dvd path
cd path
ls command will show following files of iso
[root@localhost RHEL6]# ls
EULA media.repo RELEASE-NOTES-en-US.html RELEASE-NOTES-ja-JP.html RELEASE-NOTES-pa-IN.html RELEASE-NOTES-zh-CN.html Server
GPL Packages RELEASE-NOTES-es-ES.html RELEASE-NOTES-kn-IN.html RELEASE-NOTES-pt-BR.html RELEASE-NOTES-zh-TW.html TRANS.TBL
HighAvailability README RELEASE-NOTES-fr-FR.html RELEASE-NOTES-ko-KR.html RELEASE-NOTES-ru-RU.html repodata
images RELEASE-NOTES-as-IN.html RELEASE-NOTES-gu-IN.html RELEASE-NOTES-ml-IN.html RELEASE-NOTES-si-LK.html ResilientStorage
isolinux RELEASE-NOTES-bn-IN.html RELEASE-NOTES-hi-IN.html RELEASE-NOTES-mr-IN.html RELEASE-NOTES-ta-IN.html RPM-GPG-KEY-redhat-beta
LoadBalancer RELEASE-NOTES-de-DE.html RELEASE-NOTES-it-IT.html RELEASE-NOTES-or-IN.html RELEASE-NOTES-te-IN.html RPM-GPG-KEY-redhat-release
[root@localhost RHEL6]#
step 3: find rpm with following command.
[root@localhost Packages]# ls | grep vsftpd
vsftpd-2.2.2-6.el6_0.1.i686.rpm
[root@localhost Packages]#
step 4: installing rpm
[root@localhost Packages]# rpm -ivh vsftpd-2.2.2-6.el6_0.1.i686.rpm
warning: vsftpd-2.2.2-6.el6_0.1.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ########################################### [100%]
1:vsftpd ########################################### [100%]
[root@localhost Packages]#
warning: vsftpd-2.2.2-6.el6_0.1.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ########################################### [100%]
1:vsftpd ########################################### [100%]
[root@localhost Packages]#
After installation following files will be created
1) File storing path
[root@localhost ftp]# pwd
/var/ftp
[root@localhost ftp]# ls
pub
[root@localhost ftp]#
2) configuration files
[root@localhost vsftpd]# pwd
/etc/vsftpd
[root@localhost vsftpd]# ls
ftpusers user_list vsftpd.conf vsftpd_conf_migrate.sh
[root@localhost vsftpd]#
3) Log files:
To check the status of service
[root@localhost vsftpd]# tail -100f /var/log/vsftpd.log
or
[root@localhost vsftpd]# tail -100f /var/log/xferlog
Service start:
[root@localhost log]# service vsftpd
start
Starting vsftpd for vsftpd: [ OK ]
[root@localhost log]#
Configuration
[root@localhost vsftpd]# vi vsftpd.conf
uncomment following lines
# 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
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
anon_mkdir_write_enable=YES
By this it allows ftp user, which created by package. It create system user ftp who does'nt have home directory.By this ftp user can login from any where upload and down files.
Client Configuration
ftp is client version of ftp:
yum install ftp
or
[root@localhost Packages]# ls | grep ftp-0.17-51.1.el6.i686.rpm
ftp-0.17-51.1.el6.i686.rpm
[root@localhost Packages]#
[root@localhost Packages]# rpm -ivh ftp-0.17-51.1.el6.i686.rpm
warning: ftp-0.17-51.1.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ########################################### [100%]
1:ftp ########################################### [100%]
[root@localhost Packages]#
warning: ftp-0.17-51.1.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ########################################### [100%]
1:ftp ########################################### [100%]
[root@localhost Packages]#
Once client is installed use following commands
root@localhost ~]# ftp 192.168.0.7
Connected to 192.168.0.7 (192.168.0.7).
220 (vsFTPd 2.2.2)
Connecting ftp server with ftp user
Name (192.168.0.7:root): ftp
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
Listing files
ftp> ls
227 Entering Passive Mode (192,168,0,7,222,56).
150 Here comes the directory listing.
drwxr-xr-x 4 14 50 4096 Aug 18 10:15 pub
226 Directory send OK.
ftp> cd pub
250 Directory successfully changed.
ftp> ls
227 Entering Passive Mode (192,168,0,7,159,115).
150 Here comes the directory listing.
drwxr-xr-x 10 14 50 4096 Jul 21 00:29 RHEL6
drwx------ 2 14 50 4096 Aug 18 10:17 test
226 Directory send OK.
ftp> cd test
250 Directory successfully changed.
Uploading files using put command
ftp> put test2
local: test2 remote: test2
local: test2: No such file or directory
ftp> put test1
local: test1 remote: test1
227 Entering Passive Mode (192,168,0,7,30,157).
150 Ok to send data.
226 Transfer complete.
31 bytes sent in 0.0169 secs (1.83 Kbytes/sec)
Download files using get command
ftp> get test1
local: test1 remote: test1
227 Entering Passive Mode (192,168,0,7,204,69).
550 Failed to open file.
ftp>
Note: Make sure /var/ftp/pub has access and ownership to ftp user
chown -R ftp:ftp /var/ftp/pub
Service starting/stop/restart
Service vsftpd stop -------------- stopping service
service vsftpd start --------------- starting service
service vsftpd restart------------- stopping and starting service
chkconfig vsftpd on -------------- Enable service on while booting
Port number: 21
No comments:
Post a Comment