How to Migrate LVM or Volume Group to New Linux Server

Migrate LVMThis article will describe on how to move or migrate LVM and volume group from one server to another.

If you are working in a production environment then you have to know about the software disk management and all the methods to provide flexibility in storage management.

LVM stand for logical volume management. It is a tool to manage and provides a higher-level view of the disk storage.

Below tutorial will be very useful for system administrators who have problems on the linux operating system and want to mount the mounted partition to other systems.

This should be the most simple recovery strategy if we run Linux in VMware virtual machines.

Migrating LVM or Volume Group to new server should be the fastest way to access the important linux partition that may contains user’s data or important configuration files.

How to Migrate LVM or Volume Group to New Server

1. Add vdisk to new virtual machine.

a) Click “Add” to proceed :

Migrate LVM

b) Select “Hard Disk” device type :

Migrate LVM

c) Please choose “Use and existing virtual disk” :

Migrate LVM

d) Browse to vdisk location :

Migrate LVM

e) Click Next to proceed :

Migrate LVM

f) Click finish :

Migrate LVM

g) Finally click “OK” to complete :

Migrate LVM

2. Once the vdisk as been added to new Linux server, please proceed to rescan the linux VM.

a) Identify host bus number :

# ls /sys/class/scsi_host/
host0  host1  host2

b) Rescan the SCSI Bus to Add a SCSI Devices :

# echo "- - -" > /sys/class/scsi_host/host0/scan
# echo "- - -" > /sys/class/scsi_host/host1/scan
# echo "- - -" > /sys/class/scsi_host/host2/scan

3. Check the new disk. The second vdisk by default will be recognised as /dev/sdb. Since the partition type has been formatted as LVM on the previous system, it will show Id “8e” if you run fdisk command.

# fdisk -l
..
..

Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xce931872

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1305    10482381   8e  Linux LVM

There are two method to register and activate the LVM and volume group into new linux server. Proceed to steps 4 – 9 for Method 1. Go to step 10 for Method 2.

4. Use lvscan to scans all known volume groups or all supported LVM block devices in the system for defined Logical Volumes. The output consists of one line for each Logical Volume indicating whether it is active or inactive :

# lvscan
  inactive          '/dev/vg_newlvm/newvol' [9.99 GiB] inherit
  ACTIVE            '/dev/vg_centos66/lv_root' [30.00 GiB] inherit
  ACTIVE            '/dev/vg_centos66/lv_swap' [8.00 GiB] inherit

5. Check existing volume group and logical volume:

# vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "vg_newlvm" using metadata type lvm2
  Found volume group "vg_centos66" using metadata type lvm2

One of the logical volume in “vg_newlvm” volume group still inactive status.

# lvscan
inactive '/dev/vg_newlvm/newvol' [9.99 GiB] inherit
ACTIVE '/dev/vg_centos66/lv_root' [17.51 GiB] inherit
ACTIVE '/dev/vg_centos66/lv_swap' [2.00 GiB] inherit

6. Export the volume group “vg_newlvm” :

# vgexport vg_newlvm
Volume group "vg_newlvm" successfully exported

7. Then import volume group “vg_newlvm”:

# vgimport vg_newlvm
Volume group "vg_newlvm" successfully imported

8. To activate volume groups “vg_newlvm”, run the following command :

# vgchange -ay vg_newlvm
1 logical volume(s) in volume group "vg_newlvm" now active

9. Check again updated logical volume and volume group status :

# lvscan
  ACTIVE            '/dev/vg_newlvm/newvol' [9.99 GiB] inherit
  ACTIVE            '/dev/vg_centos66/lv_root' [17.51 GiB] inherit
  ACTIVE            '/dev/vg_centos66/lv_swap' [2.00 GiB] inherit

Method 2 :

10. The fastest method to activate the migrated LVM or Volume Group are as below :

# lvscan
inactive '/dev/vg_newlvm/newvol' [9.99 GiB] inherit
ACTIVE '/dev/vg_centos66/lv_root' [17.51 GiB] inherit
ACTIVE '/dev/vg_centos66/lv_swap' [2.00 GiB] inherit

Use lvchange command to activate the LVM.

# lvchange -ay /dev/vg_newlvm/newvol
# lvscan
ACTIVE '/dev/vg_newlvm/newvol' [9.99 GiB] inherit
ACTIVE '/dev/vg_centos66/lv_root' [17.51 GiB] inherit
ACTIVE '/dev/vg_centos66/lv_swap' [2.00 GiB] inherit

11. Create /data folder :

# mkdir -p /data

12. Mount the migrated LVM to /data

# mount /dev/vg_newlvm/newvol /data

13. Verify /date to use migrated LVM :

# df -lh
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_centos66-lv_root
                       18G  5.2G   12G  32% /
tmpfs                 939M     0  939M   0% /dev/shm
/dev/sda1             477M   67M  385M  15% /boot
/dev/mapper/vg_newlvm-newvol
                      9.8G   32M  9.2G   1% /data

How to Change default runlevel in CentOS 7 / RHEL 7

Change default runlevelIn CentOS 7 and RHEL 7, the systemd process replaces the init process for starting services at boot time and also for changing the runlevels. It uses “targets” instead of run-levels and relies on systemctl command to change runlevel or to change the target.

The systemd provides much more control than the init process does while still supporting existing init scripts.

Take note that in RHEL 7 and CentOS 7, any edits of /etc/inittab file will not take effect.

The following articles describe how to change default runlevel in CentOS 7 / RHEL 7.

1. How to determine the state that the system currently configured to boot to :

# systemctl get-default

Example 1 :
If the system running on Non-GUI Mode, “systemctl get-default” command will return “multi-user.target” :

Method 1 :

[root@centos72 ~]# systemctl get-default
multi-user.target

Method 2 :

[root@centos72 ~]# ls -al /etc/systemd/system/default.target
lrwxrwxrwx. 1 root root 37 May 30  2015 default.target -> /lib/systemd/system/multi-user.target

Example 2 :
If the system running on GUI Mode, “systemctl get-default” command will return “graphical.target” :
Method 1 :

[root@centos72-gui ~]# systemctl get-default
graphical.target

Method 2 :

[root@centos72-gui ~]# ls -al /etc/systemd/system/default.target
lrwxrwxrwx. 1 root root 36 Jun  5  2015 /etc/systemd/system/default.target -> /lib/systemd/system/graphical.target

However, you can still use the runlevel command as it was left intact for backward compatibility:

[root@centos72 ~]# runlevel
N 3
[root@centos72-gui ~]# runlevel
N 5

In case you are required to change from your CentOS 7 from Non-GUI (text-based) mode to GNOME Desktop mode, you have to ensure the following group of packages has been installed properly :

a) Server with GUI (This is for server)
b) GNOME Desktop
c) Graphical Administration Tools

2. How to Install Gnome GUI in CentOS 7 :

# yum groupinstall "GNOME Desktop" "Graphical Administration Tools" "Server with GUI"

3. How to list all currently loaded and available targets :

# systemctl list-units -t target
UNIT                 LOAD   ACTIVE SUB    DESCRIPTION
basic.target         loaded active active Basic System
cryptsetup.target    loaded active active Encrypted Volumes
getty.target         loaded active active Login Prompts
graphical.target     loaded active active Graphical Interface
local-fs-pre.target  loaded active active Local File Systems (Pre)
local-fs.target      loaded active active Local File Systems
multi-user.target    loaded active active Multi-User System
network.target       loaded active active Network
paths.target         loaded active active Paths
remote-fs-pre.target loaded active active Remote File Systems (Pre)
remote-fs.target     loaded active active Remote File Systems
slices.target        loaded active active Slices
sockets.target       loaded active active Sockets
swap.target          loaded active active Swap
sysinit.target       loaded active active System Initialization
timers.target        loaded active active Timers

In below example, the following target are required to be laoded :

graphical.target     loaded active active Graphical Interface
multi-user.target    loaded active active Multi-User System

How to Change default runlevel

4. How to Change default runlevel from Non-GUI (text-based) mode to GNOME Desktop in CentOS 7 / RHEL 7

# systemctl set-default multi-user.target

5. How to Change default runlevel from GNOME Desktop to Non-GUI (text-based) mode in CentOS 7 / RHEL 7

# systemctl set-default graphical.target

Resource :
https://access.redhat.com/articles/754933

How to Disable IPv6 on Redhat / CentOS 6 / CentOS 7

This howto will show you how to disable ipv6 on RHEL 6/7, CentOS 6 and CentOS7.

IPv6 is enabled by default. In this article I summarize 3 configuration which needs to be changed to completely disable ipv6.

Check the configuration of the existing network with the “ifconfig” command. If inet6 appears in the configuration, means IPv6 is enabled.

Disable IPv6 on Redhat

Here are details on how to disable IPv6 on Redhat / CentOS 6 / CentOS 7 :

1. Update /etc/sysctl.conf :

Method 1 :

# vi /etc/sysctl.conf

Add the following :

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

Run the following command to take effect.

# sysctl -p

Disable IPv6 on Redhat

Method 2 :

To disable ipv6 in the running system :

# echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6
# echo 1 > /proc/sys/net/ipv6/conf/default/disable_ipv6

or

# sysctl -w net.ipv6.conf.all.disable_ipv6=1
# sysctl -w net.ipv6.conf.default.disable_ipv6=1

2. Update config file in/etc/sysconfig/network-scripts/ifcfg-eth0 and /etc/sysconfig/network-scripts/ifcfg-ens160 :

For CentOS 6 :

# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:0C:29:C5:36:7C
TYPE=Ethernet
UUID=f9db89e6-013a-4403-8893-ae0536c6306f
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
IPADDR=192.168.0.9
NETMASK=255.255.255.0
IPV6INIT=no

For CentOS 7 :

# vi /etc/sysconfig/network-scripts/ifcfg-ens160
TYPE="Ethernet"
BOOTPROTO="static"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="no"
IPV6_AUTOCONF="no"
IPV6_DEFROUTE="no"
IPV6_FAILURE_FATAL="yes"
NAME="ens32"
UUID="ccfd7425-20ab-40c9-a141-b71828a1b8bf"
DEVICE="ens160"
ONBOOT="yes"
IPADDR="192.168.0.100"
PREFIX="24"
GATEWAY="192.168.0.1"
DNS1="8.8.8.8"
DOMAIN="ehowstuff.local"
IPV6_PEERDNS="no"
IPV6_PEERROUTES="no"
IPV6_PRIVACY="no"

Disable IPv6 on Redhat

3. Edit /etc/sysconfig/network file and add “no” to NETWORKING_IPV6.

# vi /etc/sysconfig/network
NETWORKING_IPV6=no

Disable IPv6 on Redhat

I would advise you to restart network configuration as below :

For CentOS 6 :

# service network restart

For CentOS 7 :

# systemctl restart network

Source : https://wiki.centos.org/FAQ/CentOS6

How to Configure Linux TCP keepalive Setting

TCP keepalive Setting

In line with the increase in internet users, the traffic and workload on the web server is also increased. Hence, the webmaster or system administrator needs to make sure that the web server is able to accommodate a sufficient number of TCP connections.

If your web server has begun to show an increase in the number of visitors, you may start planning to perform basic tcp tuning on the linux operating system.

On average, most people that visit the website or blog that comes from search engines only read a page just for 1-2 minutes. After they got the answer for what they really want, they simply leave the page and visit other sites. But the old opened connection still remains and unused for a long time.

For low and average number of website visitors, the default values for the keepalive parameter should be sufficient.

But for high concurrency web server or in a busy server, decrease timeouts on TCP sockets can help to clean up the tcp connections from clients that have been disconnected. This can be done by changing the default value of tcp_keepalive setting in sysctl.conf.

What is TCP Keepalive Setting?

TCP keepalive is a mechanism for TCP connections that help to determine whether the other end has stopped responding or not.

TCP will send the keepalive probe contains null data to the network peer several times after a period of idle time. If the peer does not respond, the socket will be closed automatically.

The application will then receive a notification about the socket closure, which it should handle in the correct manner.

Most of the operating systems and hosts that support TCP also support TCP Keepalive.

Basically, tuning some of the settings in sysctl.conf really help speeding things up under heavy usage.

Tunable TCP settings can be found on /proc/sys/net/ipv4

What are the default values of TCP KeepAlive setting ?

tcp_keepalive_time = 7200 (seconds)
tcp_keepalive_intvl = 75 (seconds)
tcp_keepalive_probes = 9 (number of probes)

TCP keepalive process waits for two hours (7200 secs) for socket activity before sending the first keepalive probe, and then resend it every 75 seconds. As long as there is TCP/IP socket communications going on and active, no keepalive packets are needed.

How to Configure Linux TCP keepalive Settings ?

Please note that the following tuning is for linux operating system only. This steps has been tested in CentOS 5/6/7, RHEL 5/6/7 and Oracle Linux 6/7.

Optionally you can do further tuning of the web applications level such as Apache or Nginx web server.

1. Edit your /etc/sysctl.conf

# vi /etc/sysctl.conf

2. Add the following setting :

net.ipv4.tcp_keepalive_time = 60
net.ipv4.tcp_keepalive_intvl = 10
net.ipv4.tcp_keepalive_probes = 6

Explanation for above parameter in section a), b) and c).

3. To load settings, enter the following command :

# sysctl -p

KeepAlive Parameter Details

a) Decrease the time default value for tcp_keepalive_time connection from 7200 seconds to 60 seconds. This determine the time of connection inactivity after which the first keep alive request is sent. Parameter below shows that the TCP will begin sending keepalive null packets after 1 minute.

net.ipv4.tcp_keepalive_time = 60

b) The following parameter (tcp_keepalive_intvl) determines the keepalive probe will resend every 10 seconds after first keep alive probe. This reduce from 75 seconds to 10 seconds gap or time interval between each of the keep alive probes.

net.ipv4.tcp_keepalive_intvl = 10

c) Next parameter (tcp_keepalive_probes) is expressed in the pure number. The following setting determine the number of probes before timing out. We recommend to reduce number of retransmitted from 9 to 6 before the connection is considered broken.

net.ipv4.tcp_keepalive_probes = 6

With this, your application will detect dead TCP connections after 120 seconds (60s + 10s + 10s + 10s + 10s + 10s + 10s).

How to Setup Linux Login Banner on CentOS 6 / CentOS 7

Linux Login Banner

Most system administrators have applied linux login banner on their servers. The purpose of this linux login banner is to show some messages or warnings when ssh session connected and before entry. The message displayed in the linux login banner is dedicated either to the system administrator who wants to perform routine system maintenance or intruders who want to launch brute force attacks on the server.

Linux Login Banner on CentOS 6 / CentOS 7 / RHEl 7 / Oracle Linux 7

To enable this in ssh you have to follow this simple steps:

1. Create a /etc/mybanner file and fill it with your desired message as below

# vi /etc/mybanner
Unauthorized access to this machine is prohibited
Only authorized System Administrator can access to this system
Press  if you are not an authorized user

Save and Quit the mybanner file.

Optionally you can give warning as below if it is involved a server with highly confidential information:

This service is restricted to authorized System Administrator only. All activities on this system are logged. Unauthorized access will be fully investigated and reported to the appropriate law enforcement agencies.

2. Edit /etc/ssh/sshd_config, to look like this Banner /etc/mybanner

113
114
115 # default banner path
116 Banner /etc/mybanner
117
118

3. Restart sshd service sshd restart

4. Test your session

login as: root
Unauthorized access to this machine is prohibited
Only authorized System Administrator can access to this system
Press  if you are not an authorized user
root@192.168.2.5's password:

I hope this article gives you some ideas and essential guidance on how to setup linux Login Banner on RHEL 7 / CentOS 7/ Oracle Linux 7

 

How to Install osCommerce on CentOS 7.1

Open Source Commerce (osCommerce) is a solution for online store software and alternative to Magento. It is indeed a complete software, easily installed and configured through a web-based installation procedure. It can be used on any web server with PHP and MySQL as the basic software. In this article, I will show you how to install osCommerce on CentOS 7.1 virtual private server (VPS). Before we proceed with step osCommerce installation, this tutorial assumes CentOS 7.1 server has been installed and LAMP or LEMP software also has been setup. The steps maybe similar to RHEL 7.1 and Oracle Linux 7.

Install osCommerce software on CentOS 7.1, RHEL 7.1 and Oracle Linux 7 via command line

1. Download osCommerce Online Merchant v2.3.4 Full Package and store it on web server root directory. This post use httpd web server and /var/www/html/ as the default root directory :

# cd /var/www/html/
# wget http://www.oscommerce.com/files/oscommerce-2.3.4.zip
# unzip oscommerce-2.3.4.zip

2. The webserver is not able to save the installation parameters to its configuration files. The following files need to have their file permissions set to world-writeable (chmod 777):

# cp -Rp oscommerce-2.3.4 oscommerce
# chmod 777 /var/www/html/oscommerce/catalog/includes/configure.php
# chmod 777 /var/www/html/oscommerce/catalog/admin/includes/configure.php

3. Setup database :

# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 11
Server version: 5.5.40-MariaDB MariaDB Server

Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> CREATE DATABASE oscommercedb;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> CREATE USER oscommerceuser@localhost IDENTIFIED BY 'oscommercepassword';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES on oscommercedb.* to oscommerceuser@localhost;
Query OK, 0 rows affected (0.01 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit
Bye

osCommerce Web Installation via Browser

4. Start osCommerce Web installation by browse the osccomerce URL as below :

http://192.168.0.70/oscommerce/catalog/install/index.php

Note : Replace IP address your own server IP address :

a. Press Start:

install osCommerce

b. Enter database information :

install osCommerce

c. You will notice that there is a message “The database structure is now being imported. Please be patient during this procedure.”. Just wait untill it proceed to next page below. Click continue to proceed.

install osCommerce

d. Enter online store information :
install osCommerce

e. If you see this page, you already have a working osCommerce installed in CentOS 7.0.

install osCommerce

I hope this article gives you some ideas and essential guidance on how to install osCommerce on linux / CentOS 7.1 / RHEL 7.1 / Oracle Linux 7.

 

How to Configure FTP Server in Linux RHEL 6

In this post i will show how to install Very Secure FTP (Vsftpd) and how to configure ftp server in linux Red Hat Enterprise Linux 6 (RHEL 6). Vsftpd is a GPL licensed FTP server for UNIX systems, including Linux. It is secure and extremely fast and it is stable.

As an example I will install and configure the vsftpd server and will also transfer files from the clients running on the Windows XP command prompt.

-A linux server with ip address 192.168.1.43 running on RHEL 6 Operating system
-A window client with ip address 192.168.1.52 running on Windows XP Pro
-RHEL 6 server Running portmap/rpcbind and xinetd services
-Firewall and SElinux should be off on server

how to configure ftp server in linux

How to Install FTP Server in Linux ?

1. Install vsftpd, rpcbind and xinetd service using the following command :

# yum install vsftpd rpcbind xinetd -y

2. Check vsftpd, xinetd and rpcbind/portmap exist and installed on the server :

# rpm -qa vsftpd
vsftpd-2.2.2-6.el6.i686

# rpm -qa xinetd
xinetd-2.3.14-29.el6.i686

# rpm -qa rpcbind
rpcbind-0.2.0-8.el6.i686

3. Make all these services auto start at boot :

# chkconfig vsftpd on
# chkconfig xinetd on
# chkconfig rpcbind on

4. Check the xinetd and rpcbind status :

# service xinetd status
xinetd (pid  1326) is running...

# service rpcbind status
rpcbind (pid  1178) is running...

5. Create the a new user named ftpuser and set password :

# useradd ftpuser
# passwd ftpuser
Changing password for user ftpuser.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

6. Login as ftpuser on other terminal and create a new files named “files”.

# su - ftpuser
[ftpuser@rhel6 ~]$ cat > files
This is file created on RHEL 6 ftp server

7. Start the vsftpd service :

# service vsftpd start
Starting vsftpd for vsftpd:                                [  OK  ]

8. Stop the iptables linux firewall and disabled selinux :

# service ip6tables stop
ip6tables: Flushing firewall rules:                        [  OK  ]
ip6tables: Setting chains to policy ACCEPT: filter         [  OK  ]
ip6tables: Unloading modules:                              [  OK  ]

# service iptables stop
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Unloading modules:                               [  OK  ]
# setenforce 0
setenforce: SELinux is disabled

How to Configure FTP Server in Linux ?

9. It’s good to make backup of your original configuration file.

[root@rhel6 ~]# cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf-bak

10. login from user account and download the files :

D:\>ftp 192.168.1.43
Connected to 192.168.1.43.
220 (vsFTPd 2.2.2)
User (192.168.1.43:(none)): ftpuser
331 Please specify the password.
Password:
230 Login successful.
ftp> get files
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for files (42 bytes).
226 Transfer complete.
ftp: 42 bytes received in 0.00Seconds 42000.00Kbytes/sec.
ftp> quit
221 Goodbye.

11. Check the contain of downloaded files :

D:\>type files
This is file created on RHEL 6 ftp server

12. By default root account is not allowed to login the vsftpd server as it’s exist in /etc/vsftpd/ftpusers.

D:\>ftp 192.168.1.43
Connected to 192.168.1.43.
220 (vsFTPd 2.2.2)
User (192.168.1.43:(none)): root
530 Permission denied.
Login failed.
ftp>

13. Open /etc/vsftpd/ftpusers file. Remove or comment out the line for user “root” and add “ftpuser” instead. Users whose name are set in this file will not allowed to login from ftp.

[root@rhel6 ~]# vi /etc/vsftpd/ftpusers
# Users that are not allowed to login via ftp
#root
ftpuser
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody

14. Open /etc/vsftpd/user_list file. Remove or comment out entry in /etc/vsftpd/user_list files. Remove or comment out the line for user “root” and add “ftpuser” instead. Users whose names are set in this file are also not allowed to login from ftp even they are not prompt for password.

# vi /etc/vsftpd/user_list
# vsftpd userlist
# If userlist_deny=NO, only allow users in this file
# If userlist_deny=YES (default), never allow users in this file, and
# do not even prompt for a password.
# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers
# for users that are denied.
#root
ftpuser
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody

15. Root now allowed to access ftp server :

D:\>ftp 192.168.1.43
Connected to 192.168.1.43.
220 (vsFTPd 2.2.2)
User (192.168.1.43:(none)): root
331 Please specify the password.
Password:
230 Login successful.
ftp> quit
221 Goodbye.

16. ftpuser now not allowed to access ftp server :

D:\>ftp 192.168.1.43
Connected to 192.168.1.43.
220 (vsFTPd 2.2.2)
User (192.168.1.43:(none)): ftpuser
530 Permission denied.
Login failed.
ftp>

17. How to set login banner for ftp server :
Open /etc/vsftpd/vsftpd.conf look for “ftpd_banner” :

# vi /etc/vsftpd/vsftpd.conf

Uncomment ftpd_banner and customize the login banner string as below :

# You may fully customise the login banner string:
ftpd_banner=Welcome to eHowStuff.com RHEL6 FTP server
#

18 Restart the ftp service :

# service vsftpd restart
Shutting down vsftpd:                                      [  OK  ]
Starting vsftpd for vsftpd:                                [  OK  ]

19. Try login to ftp server. Check the banner, it will appear before user login as below :

D:\>ftp 192.168.1.43
Connected to 192.168.1.43.
220 Welcome to eHowStuff.com RHEL6 FTP server
User (192.168.1.43:(none)):

If you encounter any issues on how to configure ftp server in linux, you can put a few questions in the comments below.

How to Install FTP Server Linux using ProFTPd

FTP Server Linux

Proftpd is one of the most popular FTP server, secure and reliable for the Linux operating system. Proftpd using a single configuration file and it is very easy to set up. The purpose of this article is to show you how easy it is to install FTP Server Linux ProFTPd server in CentOS 6 Linux.

What is FTP Server Linux?

FTP, which stands for File Transfer Protocol is a standard for exchanging program and data files across a network. The network could be the World Wide Web or simply a local area network (LAN).

Prerequisite :
How to Add the RPMforge Repository on CentOS 6/RHEL 6 Linux Server

1. Simply run this command to install FTP server linux, ProFTPd on CentOS 6 :

# yum install proftpd -y

2. How to start proftpd service :

# /etc/init.d/proftpd start

3. How to stop proftpd service :

# /etc/init.d/proftpd stop

4. How to restart proftpd service :

# /etc/init.d/proftpd restart

5. Configure proftpd start at boot :

[root@centos62 ~]# chkconfig proftpd on

If you encountered any issues while installing FTP Server Linux using proftpd, you can put a few questions in the comments below.

 

How to Install Linux FTP Server using Vsftpd

Vsftpd stands for Very Secure FTP Daemon. Vsftpd is not just another popular Unix / Linux FTP Server, but vsftpd delivering outstanding performance by taking less memory. It is running under xinetd and allows you run one process less because xinetd is shared among various other small services. For those webmasters or blogger who intend to run web server on Virtual Private Server (VPS) or Dedicated Server, Vsftpd would be the best choice. It is easy to install and can perform all that we expect from an FTP daemon while maintaining a higher level of security if configured properly. This article focuses on and covers the installation and configuration of the FTP server Vsftpd on CentOS Linux VPS.

1. Installing Linux FTP Server, vsftpd using yum command :

# yum install vsftpd -y

2. Makesure that xinetd has been installed :

# rpm -qa xinetd

If not installed, execute the following command :

# yum install xinetd -y

3. Make xinetd and Vsftpd daemon start at boot :

# chkconfig vsftpd on
# chkconfig xinetd on

4. It is recommended to do backup of your original configuration file, before do changes :

# cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf-bak

5. Configure Vsftpd :

# vi /etc/vsftpd/vsftpd.conf

a) Uncomment ftpd_banner and customize the login banner string as below :

# You may fully customise the login banner string:
ftpd_banner=Welcome to Linux FTP service.
#

b) This step is to configure not allowed users. By default root account is not allowed to login the vsftpd server as it’s existed on /etc/vsftpd/ftpusers. To allow it, open /etc/vsftpd/ftpusers files and remove or comment on the line of a user “root”. Users whose name are set in this file will not allow to login from ftp.

# cat /etc/vsftpd/ftpusers
# Users that are not allowed to login via ftp
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody

6. Test root login from windows command prompt at client PC using user, ehowstuff :

C:\>ftp 192.168.2.54
Connected to 192.168.2.54.
220 Welcome to Linux CentOS FTP service.
User (192.168.2.54:(none)): ehowstuff
331 Please specify the password.
Password:
230 Login successful.
ftp>

If you encounter any issues when setting up linux ftp server, you can put a few questions in the comments below.

linux ftp server

Credit : www.unixmen.com