About Me

My photo
Hi Friends, I am Sandeep CC and some people know me as System Administrator. I have started my professional career from 2008. I have been working as System Administrator on Linux Server and Windows Client. I am here to share my Knowledge in which I have experienced and which I have come across till now, It could be help to you people. In case anything wrong or any improvements in my post steps, Please comment to the post, Feel free to contact me by posting comments on this blog. Thanks and Regards, Sandeep CC

Wednesday, March 10, 2010

FTP Configuration On REDHAT LINUX-4


RHEL server comes with vsftpd which is the Very Secure File
Transfer Protocol (FTP) daemon. The server can be launched
via a xinetd or as standalone mode, in which case vsftpd
itself will listen on the network port 21.


Install vsftpd rpm by CD driver (vsftpd application is available in redhat OS CD)
Install Vsftpd:
root ]# /media
media]# ls -l
media] cp vsftpd-2.0.1-5.EL4.3.x86_64.rpm /var/
media]# exit
root ]# cd /var/
var]# ls -ltr
var]# rpm -i vsftpd-2.0.1-5.EL4.3.x86_64.rpm (rpm -i vsftpd-2.0.1-5.EL4.3.x86_64.rpm –nodeps) [Or else we can also use yum to install instead of rpm)
root ]#

Turn on Vsftpd Service:
root ]# service vsftpd start (For Stop @ root ]# service vsftpd stop/status)

Open FTP Port
root ]# cd /etc/sysconfig/
root ]# ls -l
root ]# vi iptables
(Append following line to open ftp port 21 before REJECT line:)
Ports: 20 for data transmission & 21 for ftp controller

root ]# -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 20 -j ACCEPT
root ]# -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
root ]# (press Esc) :wq

Restart Iptables/Firewall
root ]# service iptables start

Test with FTP
root ]# ftp (Try 1st test with same machine then go to other)

(The default configuration file is /etc/vsftpd/vsftpd.conf file. # vi /etc/vsftpd/vsftpd.conf)

Create the user.
useradd ftp1
passwd ftp1123

Edit FTP Conf file:-
root ]# vi /etc/vsftpd/vsftpd.conf
(Add this line at the end of the file)
userlist_deny=NO (This option use for ftp users, if you give NO then you have to add, needed users in /etc/vsftd.user_list or else if you give YES then all user have ftp permissions means any normal users can access ftp server)

Edit user_list file,
root ]# vi /etc/vsftpd.user_list
(And add the above created users in this file to access FTP server)

Restart FTP services
/etc/init.d/vsftpd start/restart
chkconfig vsftpd on ( for permanent on )

* Create some user and password.
* Then Try with Windows system.

To Disable Root Directory

[root@server vsftpd]# vi vsftpd.conf
chroot_list_enable=YES ----> Remove #
chroot_list_file=/etc/vsftpd/chroot_list ----> Remove # & Give path of chroot_list file
[Create one file in /etc/vsftpd/chroot_list & Put users name, which users needed access of ftp]

We can transfer the data from Linux to Windows by using FTP (by using win XP machine), If we require to transfer data from Window to Linux (by using Linux machine) then we have to enable FTP port (21) in windows machine.

No comments:

Post a Comment