• VMware

    Learn about VMware virtualization for its products like vsphere ESX and ESXi, vCenter Server, VMware View, VMware P2V and many more

  • Linux

    Step by step configuration tutorials for many of the Linux services like DNS, DHCP, FTP, Samba4 etc including many tips and tricks in Red Hat Linux.

  • Database

    Learn installation and configuration of databases like Oracle, My SQL, Postgresql, etc including many other related tutorials in Linux.

  • Life always offers you a second chance ... Its called tomorrow !!!

    Friday, August 10, 2012

    How to configure FTP server in Linux

    There are many types of services available which can be used to configre FTP server in Linux. In this particular artical I will be showing you the most simple FTP server with least features. As vSFTPD is very fast many rules can be implemented using this server but it depends on the user and requirement.

    VSFTPD means Very Secure FTP Daemon where FTP stands for File Transfer Protocol.

    To start with the configuration check for the packages required
    # rpm -qa | grep vsftpd
    # yum -y install vsftpd

    The details of all the syntax used in the config file have been explained in brief so you can opt for the option as per your requirement
    # vi /etc/vsftpd/vsftpd.conf
    (you have to check for all these parameters)
    Allow anonymous FTP?
    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
    anon_upload_enable=YES
    # You may specify an explicit list of local users to chroot() to their home
    # directory. If chroot_local_user is YES, then this list becomes a list of
    # users to NOT chroot().
    #chroot_local_user=YES

    pam_service_name=vsftpd
    userlist_enable=YES
    tcp_wrappers=YES

    Restart your service
    # service vsftpd restart
    If you want to prohibit few users from logging into the ftp server then add the following parameter in your config file
    userlist_deny=YES
    # vi /etc/vsftpd/user_list
    user1
    user2

    To change the default login directory of anonymous users .
    Add this parameter in vsftpd.conf file
    # vi /etc/vsftpd/vsftpd.conf
    anon_root=/path_to_dir
    (Make sure the permission on this directory is proper to be accessible by the required user)

    To change the default login directory for any user on the ftp server as by default the user always logs into his/her home directory.
    Add this paramenter in vsftpd.conf
    user_config_dir=/etc/vsftpd/vsftpd_user_conf
    save and exit
    # cd /etc/vsftpd/
    Create a new file vsftpd_user_conf
    # vi vsftpd_user_conf
    local_root=/path_to_directory

    # service vsftpd restart

    Follow the below links for more helpful tutorials

    How to find the path of any command in Linux
    How to configure a Clustered Samba share using ctdb in Red Hat Cluster
    How to delete an iscsi-target from openfiler and Linux
    How to perform a local ssh port forwarding in Linux
    How to use yum locally without internet connection using cache?
    What is umask and how to change the default value permanently?
    Understanding Partition Scheme MBR vs GPT
    How does a successful or failed login process works in Linux
    How to find all the process accessing a file in Linux
    How to exclude multiple directories from du command in Linux
    How to configure autofs in Linux and what are its advantages?
    How to resize software raid partition in Linux
    How to configure Software RAID 1 mirroring in Linux
    How to prevent a command from getting stored in history in Linux

    2 comments:

    1. Can you also please provide iptables rules to be used for all the server configuration

      Thanks

      ReplyDelete
      Replies
      1. I have started writing posts provide tutorials on iptables so you can try to learn on how to use iptables and creating rules.

        You can follow the same here
        http://www.golinuxhub.com/2013/09/basic-iptables-tutorial-in-linux.html

        It would be helpful if you can give feedback for the same which can help me improve my posts.

        Thank You

        Delete