Setup vsftpd Service on CentOS 6.5

vsftpd is a free FTP service for UNIX and linux systems. It is very stable, fast and secure ftp server. In this post, i will share how to setup sftpd Service on CentOS 6.5. The steps has been tested working fine with other version of CentOS 6.

1. Install vsftpd ftp service :

[root@server-05 ~]# yum install vsftpd -y

Example :

[root@server-05 ~]# yum install vsftpd -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.upsi.edu.my
 * extras: mirror.upsi.edu.my
 * updates: mirror.upsi.edu.my
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package vsftpd.x86_64 0:2.2.2-11.el6_4.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package              Arch                 Version                         Repository          Size
====================================================================================================
Installing:
 vsftpd               x86_64               2.2.2-11.el6_4.1                base               151 k

Transaction Summary
====================================================================================================
Install       1 Package(s)

Total download size: 151 k
Installed size: 331 k
Downloading Packages:
vsftpd-2.2.2-11.el6_4.1.x86_64.rpm                                           | 151 kB     00:03
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : vsftpd-2.2.2-11.el6_4.1.x86_64                                                   1/1
  Verifying  : vsftpd-2.2.2-11.el6_4.1.x86_64                                                   1/1

Installed:
  vsftpd.x86_64 0:2.2.2-11.el6_4.1

Complete!

2. Install ftp client on linux :

[root@server-05 ~]# yum install ftp -y

3. Create local user1 to access ftp service.

[root@server-05 ~]# useradd user1
[root@server-05 ~]# passwd user1
Changing password for user user1.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

4. Add user1 into vsftpd userlist as below :

[root@server-05 ~]# vi /etc/vsftpd/user_list
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody
user1

5. Disabled anonymous access:

anonymous_enable=YES

to below :

anonymous_enable=NO

6. Add the following to bottom of the config file. If userlist_deny=NO, only allow users in this file :

userlist_deny=NO

7. Update the following banner :

ftpd_banner=Welcome to ehowstuff FTP service.

8. Start vsftpd service :

[root@server-05 ~]# service vsftpd start
Starting vsftpd for vsftpd:                                [  OK  ]

9. Configure vsftpd daemon start automatically on booting :

[root@server-05 ~]# chkconfig vsftpd on

10. Test ftp service connection from windows client using user1 :


C:\>ftp 192.168.0.5
Connected to 192.168.0.5.
220 Welcome to ehowstuff FTP service.
User (192.168.0.5:(none)): user1
331 Please specify the password.
Password:
230 Login successful.
ftp> bye
221 Goodbye.

11. Test ftp service connection from linux client using user1 :

[root@server-05 ~]# ftp 192.168.0.5
Connected to 192.168.0.5 (192.168.0.5).
220 Welcome to ehowstuff FTP service.
Name (192.168.0.5:root): user1
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> exit
221 Goodbye.

Download CentOS 6.5 x86_64 and x86 ISO

CentOS 6.5 has just been released on 1st December 2013. CentOS is an Enterprise-class Linux Distribution derived from sources freely provided to the public. It has 100% binary compatibility with its upstream source, Red Hat Enterprise Linux (RHEL).

Released Note :

http://wiki.centos.org/Manuals/ReleaseNotes/CentOS6.5

Major changes :
-The Precision Time Protocol – previously a technology preview – is now fully supported. The following drivers support network time stamping: bnx2x, tg3, e1000e, igb, ixgbe, and sfc.
-OpenSSL has been updated to version 1.0.1.
-OpenSSL and NSS now support TLS 1.1 and 1.2.
-KVM received various enhancements. These include improved read-only support of VMDK- and VHDX-Files, CPU hot plugging and updated virt-v2v-/virt-p2v-conversion tools.
-Hyper-V and VMware drivers have been updated.
-Updates to Evolution (2.32) and Libre Office (4.0.4).

Download URL for x86 and x64 ISO
http://mirrors.hostemo.com/CentOS/6.5/isos/x86_64/
http://mirrors.hostemo.com/CentOS/6.5/isos/i386/

Disable SELinux on CentOS 6.5

This post will show how to disable Security-Enhanced Linux (SELinux) on CentOS 6.5. The steps was very simple, but if we did not disable this feature, you may hit a problem when try to do software installation. SELinux checking for allowed operations after standard Linux discretionary access controls are checked.

1. Check selinux status :

[root@centos6 ~]# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   enforcing
Mode from config file:          enforcing
Policy version:                 24
Policy from config file:        targeted

2. Disable SELinux on CentOS 6.4 permanently :

[root@centos6 ~]# vi /etc/sysconfig/selinux

Change “SELINUX=enforcing” to “SELINUX=disabled” :

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

3. Reboot CentOS 6.5 Operating system :

[root@centos6 ~]# init 6

or

[root@centos6 ~]# reboot

How to Install VMware Tools on CentOS 6.5

vmwaretoolsVMware Tools is one of important components in order to run virtual machine (VM) with excellent performance. It is a group of utilities that help to enhances the overall performance of the virtual machine’s guest operating system (OS) and improves management of the VM. Without the VMware Tools, guest OS performance will lacks some of the important functionality. Below steps shows how to install the VMware Tools on CentOS 6.5 :

1. Install the prerequisites into your CentOS 6.5.

[root@centos6 ~]# yum install perl gcc make kernel-headers kernel-devel -y

Example.

[root@centos6 ~]# yum install perl gcc make kernel-headers kernel-devel -y
Loaded plugins: fastestmirror
base                                                                         | 3.7 kB     00:00
http://ossm.utm.my/centos/6.5/os/x86_64/repodata/617a880b84a87969e04bfeebb1b96d5f441da42ee931d374fa6b6d57decd821e-primary.sqlite.bz2: [Errno 12] Timeout on http://ossm.utm.my/centos/6.5/os/x86_64/repodata/617a880b84a87969e04bfeebb1b96d5f441da42ee931d374fa6b6d57decd821e-primary.sqlite.bz2: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds')
Trying other mirror.
base/primary_db                                                              | 4.4 MB     00:49
extras                                                                       | 3.4 kB     00:00
extras/primary_db                                                            |  18 kB     00:00
updates                                                                      | 3.4 kB     00:00
updates/primary_db                                                           |  65 kB     00:00
Setting up Install Process
Package 1:make-3.81-20.el6.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package gcc.x86_64 0:4.4.7-4.el6 will be installed
--> Processing Dependency: libgomp = 4.4.7-4.el6 for package: gcc-4.4.7-4.el6.x86_64
--> Processing Dependency: cpp = 4.4.7-4.el6 for package: gcc-4.4.7-4.el6.x86_64
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.4.7-4.el6.x86_64
--> Processing Dependency: cloog-ppl >= 0.15 for package: gcc-4.4.7-4.el6.x86_64
--> Processing Dependency: libgomp.so.1()(64bit) for package: gcc-4.4.7-4.el6.x86_64
---> Package kernel-devel.x86_64 0:2.6.32-431.el6 will be installed
---> Package kernel-headers.x86_64 0:2.6.32-431.el6 will be installed
---> Package perl.x86_64 4:5.10.1-136.el6 will be installed
--> Processing Dependency: perl-libs = 4:5.10.1-136.el6 for package: 4:perl-5.10.1-136.el6.x86_64
--> Processing Dependency: perl-libs for package: 4:perl-5.10.1-136.el6.x86_64
--> Processing Dependency: perl(version) for package: 4:perl-5.10.1-136.el6.x86_64
--> Processing Dependency: perl(Pod::Simple) for package: 4:perl-5.10.1-136.el6.x86_64
--> Processing Dependency: perl(Module::Pluggable) for package: 4:perl-5.10.1-136.el6.x86_64
--> Processing Dependency: libperl.so()(64bit) for package: 4:perl-5.10.1-136.el6.x86_64
--> Running transaction check
---> Package cloog-ppl.x86_64 0:0.15.7-1.2.el6 will be installed
--> Processing Dependency: libppl_c.so.2()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64
--> Processing Dependency: libppl.so.7()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64
---> Package cpp.x86_64 0:4.4.7-4.el6 will be installed
--> Processing Dependency: libmpfr.so.1()(64bit) for package: cpp-4.4.7-4.el6.x86_64
---> Package glibc-devel.x86_64 0:2.12-1.132.el6 will be installed
--> Processing Dependency: glibc-headers = 2.12-1.132.el6 for package: glibc-devel-2.12-1.132.el6.x86_64
--> Processing Dependency: glibc-headers for package: glibc-devel-2.12-1.132.el6.x86_64
---> Package libgomp.x86_64 0:4.4.7-4.el6 will be installed
---> Package perl-Module-Pluggable.x86_64 1:3.90-136.el6 will be installed
---> Package perl-Pod-Simple.x86_64 1:3.13-136.el6 will be installed
--> Processing Dependency: perl(Pod::Escapes) >= 1.04 for package: 1:perl-Pod-Simple-3.13-136.el6.x86_64
---> Package perl-libs.x86_64 4:5.10.1-136.el6 will be installed
---> Package perl-version.x86_64 3:0.77-136.el6 will be installed
--> Running transaction check
---> Package glibc-headers.x86_64 0:2.12-1.132.el6 will be installed
---> Package mpfr.x86_64 0:2.4.1-6.el6 will be installed
---> Package perl-Pod-Escapes.x86_64 1:1.04-136.el6 will be installed
---> Package ppl.x86_64 0:0.10.2-11.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                         Arch             Version                      Repository      Size
====================================================================================================
Installing:
 gcc                             x86_64           4.4.7-4.el6                  base            10 M
 kernel-devel                    x86_64           2.6.32-431.el6               base           8.7 M
 kernel-headers                  x86_64           2.6.32-431.el6               base           2.8 M
 perl                            x86_64           4:5.10.1-136.el6             base            10 M
Installing for dependencies:
 cloog-ppl                       x86_64           0.15.7-1.2.el6               base            93 k
 cpp                             x86_64           4.4.7-4.el6                  base           3.7 M
 glibc-devel                     x86_64           2.12-1.132.el6               base           978 k
 glibc-headers                   x86_64           2.12-1.132.el6               base           608 k
 libgomp                         x86_64           4.4.7-4.el6                  base           118 k
 mpfr                            x86_64           2.4.1-6.el6                  base           157 k
 perl-Module-Pluggable           x86_64           1:3.90-136.el6               base            40 k
 perl-Pod-Escapes                x86_64           1:1.04-136.el6               base            32 k
 perl-Pod-Simple                 x86_64           1:3.13-136.el6               base           212 k
 perl-libs                       x86_64           4:5.10.1-136.el6             base           578 k
 perl-version                    x86_64           3:0.77-136.el6               base            51 k
 ppl                             x86_64           0.10.2-11.el6                base           1.3 M

Transaction Summary
====================================================================================================
Install      16 Package(s)

Total download size: 40 M
Installed size: 98 M
Downloading Packages:
(1/16): cloog-ppl-0.15.7-1.2.el6.x86_64.rpm                                  |  93 kB     00:00
(2/16): cpp-4.4.7-4.el6.x86_64.rpm                                           | 3.7 MB     00:42
(3/16): gcc-4.4.7-4.el6.x86_64.rpm                                           |  10 MB     01:40
(4/16): glibc-devel-2.12-1.132.el6.x86_64.rpm                                | 978 kB     00:09
(5/16): glibc-headers-2.12-1.132.el6.x86_64.rpm                              | 608 kB     00:06
(6/16): kernel-devel-2.6.32-431.el6.x86_64.rpm                               | 8.7 MB     01:25
(7/16): kernel-headers-2.6.32-431.el6.x86_64.rpm                             | 2.8 MB     00:30
(8/16): libgomp-4.4.7-4.el6.x86_64.rpm                                       | 118 kB     00:01
(9/16): mpfr-2.4.1-6.el6.x86_64.rpm                                          | 157 kB     00:01
(10/16): perl-5.10.1-136.el6.x86_64.rpm                                      |  10 MB     01:35
(11/16): perl-Module-Pluggable-3.90-136.el6.x86_64.rpm                       |  40 kB     00:00
(12/16): perl-Pod-Escapes-1.04-136.el6.x86_64.rpm                            |  32 kB     00:00
(13/16): perl-Pod-Simple-3.13-136.el6.x86_64.rpm                             | 212 kB     00:01
(14/16): perl-libs-5.10.1-136.el6.x86_64.rpm                                 | 578 kB     00:05
(15/16): perl-version-0.77-136.el6.x86_64.rpm                                |  51 kB     00:00
(16/16): ppl-0.10.2-11.el6.x86_64.rpm                                        | 1.3 MB     00:11
----------------------------------------------------------------------------------------------------
Total                                                               103 kB/s |  40 MB     06:35
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
 Userid : CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>
 Package: centos-release-6-5.el6.centos.11.1.x86_64 (@anaconda-CentOS-201311272149.x86_64/6.5)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 1:perl-Pod-Escapes-1.04-136.el6.x86_64                                          1/16
  Installing : 4:perl-libs-5.10.1-136.el6.x86_64                                               2/16
  Installing : 1:perl-Pod-Simple-3.13-136.el6.x86_64                                           3/16
  Installing : 3:perl-version-0.77-136.el6.x86_64                                              4/16
  Installing : 1:perl-Module-Pluggable-3.90-136.el6.x86_64                                     5/16
  Installing : 4:perl-5.10.1-136.el6.x86_64                                                    6/16
  Installing : ppl-0.10.2-11.el6.x86_64                                                        7/16
  Installing : cloog-ppl-0.15.7-1.2.el6.x86_64                                                 8/16
  Installing : mpfr-2.4.1-6.el6.x86_64                                                         9/16
  Installing : cpp-4.4.7-4.el6.x86_64                                                         10/16
  Installing : libgomp-4.4.7-4.el6.x86_64                                                     11/16
  Installing : kernel-headers-2.6.32-431.el6.x86_64                                           12/16
  Installing : glibc-headers-2.12-1.132.el6.x86_64                                            13/16
  Installing : glibc-devel-2.12-1.132.el6.x86_64                                              14/16
  Installing : gcc-4.4.7-4.el6.x86_64                                                         15/16
  Installing : kernel-devel-2.6.32-431.el6.x86_64                                             16/16
  Verifying  : 1:perl-Module-Pluggable-3.90-136.el6.x86_64                                     1/16
  Verifying  : kernel-headers-2.6.32-431.el6.x86_64                                            2/16
  Verifying  : cpp-4.4.7-4.el6.x86_64                                                          3/16
  Verifying  : glibc-devel-2.12-1.132.el6.x86_64                                               4/16
  Verifying  : 1:perl-Pod-Escapes-1.04-136.el6.x86_64                                          5/16
  Verifying  : libgomp-4.4.7-4.el6.x86_64                                                      6/16
  Verifying  : 4:perl-5.10.1-136.el6.x86_64                                                    7/16
  Verifying  : mpfr-2.4.1-6.el6.x86_64                                                         8/16
  Verifying  : 4:perl-libs-5.10.1-136.el6.x86_64                                               9/16
  Verifying  : 1:perl-Pod-Simple-3.13-136.el6.x86_64                                          10/16
  Verifying  : kernel-devel-2.6.32-431.el6.x86_64                                             11/16
  Verifying  : gcc-4.4.7-4.el6.x86_64                                                         12/16
  Verifying  : 3:perl-version-0.77-136.el6.x86_64                                             13/16
  Verifying  : ppl-0.10.2-11.el6.x86_64                                                       14/16
  Verifying  : cloog-ppl-0.15.7-1.2.el6.x86_64                                                15/16
  Verifying  : glibc-headers-2.12-1.132.el6.x86_64                                            16/16

Installed:
  gcc.x86_64 0:4.4.7-4.el6                          kernel-devel.x86_64 0:2.6.32-431.el6
  kernel-headers.x86_64 0:2.6.32-431.el6            perl.x86_64 4:5.10.1-136.el6

Dependency Installed:
  cloog-ppl.x86_64 0:0.15.7-1.2.el6                   cpp.x86_64 0:4.4.7-4.el6
  glibc-devel.x86_64 0:2.12-1.132.el6                 glibc-headers.x86_64 0:2.12-1.132.el6
  libgomp.x86_64 0:4.4.7-4.el6                        mpfr.x86_64 0:2.4.1-6.el6
  perl-Module-Pluggable.x86_64 1:3.90-136.el6         perl-Pod-Escapes.x86_64 1:1.04-136.el6
  perl-Pod-Simple.x86_64 1:3.13-136.el6               perl-libs.x86_64 4:5.10.1-136.el6
  perl-version.x86_64 3:0.77-136.el6                  ppl.x86_64 0:0.10.2-11.el6

Complete!

2. Attach the vmware tools sofware from vSphere client. Assumed that the host is ESXi 4.1.
1

3. Mount the attached vmware tool software.
[root@centos6 tmp]# mount /dev/cdrom /mnt
[root@centos6 tmp]# cd /mnt
[root@centos6 tmp]# ls
VMwareTools-8.3.7-341836.tar.gz  yum.log

4. Extract the VMware tools

[root@centos6 tmp]# tar xzvf VMwareTools-8.3.7-341836.tar.gz

5. Start install by issue command “./vmware-install.pl”

[root@centos6 tmp]# cd vmware-tools-distrib
[root@centos6 vmware-tools-distrib]# ls
bin  doc  etc  FILES  INSTALL  installer  lib  vmware-install.pl
[root@centos6 vmware-tools-distrib]# ./vmware-install.pl

Full installation as below :

[root@centos6 vmware-tools-distrib]# ./vmware-install.pl
Creating a new VMware Tools installer database using the tar4 format.

Installing VMware Tools.

In which directory do you want to install the binary files?
[/usr/bin]

What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
[/etc/rc.d]

What is the directory that contains the init scripts?
[/etc/rc.d/init.d]

In which directory do you want to install the daemon files?
[/usr/sbin]

In which directory do you want to install the library files?
[/usr/lib/vmware-tools]

The path "/usr/lib/vmware-tools" does not exist currently. This program is
going to create it, including needed parent directories. Is this what you want?
[yes]

In which directory do you want to install the documentation files?
[/usr/share/doc/vmware-tools]

The path "/usr/share/doc/vmware-tools" does not exist currently. This program
is going to create it, including needed parent directories. Is this what you
want? [yes]

The installation of VMware Tools 8.3.7 build-341836 for Linux completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".

Before running VMware Tools for the first time, you need to configure it by
invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want
this program to invoke the command for you now? [yes]

Initializing...

Stopping VMware Tools services in the virtual machine:
   Guest operating system daemon:                          [  OK  ]
   Virtual Printing daemon:                                [  OK  ]
   Unmounting HGFS shares:                                 [  OK  ]
   Guest filesystem driver:                                [  OK  ]

The module vmmemctl has already been installed on this system by another
installer or package and will not be modified by this installer.  Use the flag
--clobber-kernel-modules=vmmemctl to override.

Found a compatible pre-built module for vmhgfs.  Installing it...

Found a compatible pre-built module for vmxnet.  Installing it...

Found a compatible pre-built module for vmblock.  Installing it...

Found a compatible pre-built module for vmci.  Installing it...

Found a compatible pre-built module for vsock.  Installing it...

The module vmxnet3 has already been installed on this system by another
installer or package and will not be modified by this installer.  Use the flag
--clobber-kernel-modules=vmxnet3 to override.

The module pvscsi has already been installed on this system by another
installer or package and will not be modified by this installer.  Use the flag
--clobber-kernel-modules=pvscsi to override.

No X install found.

Creating a new initrd boot image for the kernel.
   Checking acpi hot plug                                  [  OK  ]
Starting VMware Tools services in the virtual machine:
   Switching to guest configuration:                       [  OK  ]
   VM communication interface:                             [  OK  ]
   VM communication interface socket family:               [  OK  ]
   Guest operating system daemon:                          [  OK  ]
   Virtual Printing daemon:                                [  OK  ]

The configuration of VMware Tools 8.3.7 build-341836 for Linux for this running
kernel completed successfully.

You must restart your X session before any mouse or graphics changes take
effect.

You can now run VMware Tools by invoking the following command:
"/usr/bin/vmware-toolbox" during an X server session.

To enable advanced X features (e.g., guest resolution fit, drag and drop, and
file and text copy/paste), you will need to do one (or more) of the following:
1. Manually start /usr/bin/vmware-user
2. Log out and log back into your desktop session; and,
3. Restart your X session.

Enjoy,

--the VMware team

/sbin/restorecon:  Warning no default label for /tmp/vmware-block-restore0/tmp_file