How to Install and Configure VsFTPD on Rasberry Pi

I have chosen to use VsFTPD instead of ProFTP for it’s simple configuration but robust high load capability.

This steps can be implemented on any debian based linux systems like ubuntu, Rasbian and very many others. I have RaspBMC (an XBMC Media Centre) running on my Rasberry Pi.

STEP 1: Installation

As in any other debian based Linux systems, the installation of the FTP server can be done simply by executing the following command:

$ sudo apt-get install vsftpd

This command installs and start the ftp server automatically.

This is an example of the VsFTPD configuration file (/etc/vsftpd.conf):

——– start ———–

listen=NO
pamservicename=ftp
anonymousenable=NO
local
enable=YES
writeenable=YES
dirmessage
enable=YES
uselocaltime=YES
xferlog
enable=NO
connectfromport20=YES
ftpd
banner=Raspbmc FTP Server
securechrootdir=/var/run/vsftpd/empty
pamservicename=vsftpd
rsacertfile=/etc/ssl/private/vsftpd.pem
localroot=/home/$USER/publichtml
localumask=022
chroot
localuser=YES
user
subtoken=$USER
allow
writeable_chroot=YES

——– stop —————

STEP 2: Configuration

Stand-alone mode:

The ftp server can either be configured in stand-alone or normal mode. By default the VsFTPD automatically configured as stand-alone. This means that the server have its own startup scripts called daemon. In that case, the VsFTPD daemon can be started by executing “/etc/init.d/vsftpd start”. The server in stand-alone mode can further be managed with stop, restart, status and reload.

Normal mode:

The other approach to configure the VsFTPD server is to use “xinetd” to start the FTP service in normal mode. This helps to keep the FTP service alive. In order to achieve this objective, we first need to install the “xinetd” super server by executing the following command:

$ sudo apt-get install xinetd

The above command will install and start the xinetd super server on your system automatically. However, there is the chance that “xinetd” is already installed on your system. In that case, please skip the step above.

Next, create a file called vsftpd in /etc/xinetd.d/ with the following content:

service ftp
{
disable = no
sockettype = stream
wait = no
user = /usr/sbin/vsftpd
per
source = 5
instances = 200
noaccess = 192.168.1.0/24 #use this to block any connections from this network
onlyfrom = 192.168.1.0/24 #use this to allow connections only from this network
bannerfail = /etc/vsftpd.busy
log
onsuccess += PID HOST DURATION
log
on_failure += HOST

}

Pleas alter any of these options to match your system configurations.

  • server – to get the correct path to enter here, type “which vsftpd” on the terminal
  • noaccess – this will block any host or hosts defined here
  • bannerfail – this should the path to the file with the text to show to any blocked IP address

STEP 3: /etc/vsftpd.conf Configuration

Open the file /etc/vsftpd.conf and change

listen=YES

to

listen=NO

This instructs the FTP server not to open any ports but let “xinetd” control and manage the entire ports and services. In order for the normal mode to run smoothly, we need to first stop the vsftpd service by executing the following command:

$ sudo service vsftpd stop

followed by

$ sudo service xinetd reload

We have to test and confirm that the FTP server have been started in normal mode and that the port 21 is open by the following command:

$ sudo netstat -ant | grep 21

You should see this:

tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN


Posted in FTP, Linux, Linux Installation, VsFTP and tagged , , by with comments disabled.

VMware STOP: 0x0000005d Error

Warning:

I am NOT the original author of this article. You can find the original article here!

I recently ran into this error while trying to install Windows 2008 R2 Server 64 Bit on my corporate virtual network. Windows 2003 server standard was initially installed on this same configuration. The aim of the project was to remove the Windows 2003 server and install windows 2008 R2 server on it the system. Well, I completely forgot before starting that I had to change the guest operating system type. this eventually lead to this error.

After searching a while on google, I came accross the above mentioned article. It saved my day! The question is why repeat the same thing here? Well, I decided to repeat this here for my personal reference only. It might be useful for someone else too.


Posted in Linux, Linux Installation, VMware and tagged , , by with comments disabled.

CentOS 6.4 Netinstall

Download the network installation iso file and burn to CD.
Place the CD in the CD-Rom and reboot the system.
When ask to select the network install method, choose “HTTP” and enter the following:

1) for 32 Bit
Host: mirror.centos.org
Directory: centos/6.4/os/i386

2) for 64 Bit
Host: mirror.centos.org
Directory: centos/6.4/os/x86_64

Posted in CentOS, Linux, Linux Installation and tagged , , by with comments disabled.

CentOS 6.3 NetInstall

Download the network installation iso file and burn to CD.

Place the CD in the CD-Rom and reboot the system.

When ask to select the network install method, choose “HTTP” and enter the following:

1) for 32 Bit
Host: mirror.centos.org
Directory: centos/6.3/os/i386

2) for 64 Bit
Host: mirror.centos.org
Directory: centos/6.3/os/x86_64


Posted in CentOS, Linux, Linux Installation and tagged , , , by with comments disabled.

Add Gnome/Gui to a Minimal CentOS 6.3 Linux System

I recently used the netinstall CentOS CD to install one of my Linux systems. During the installation process, I decided to install CentOS 6.3 minimal to quiken the overall install process. After the successful installation, I decided it was time to add Gnome/GUI to the system. The following were the steps taken to achive this task.

First, it is worth mentioning that there are two versions of this installation.

a.) Short version

b.) Long version

 

STEPS:

a. ) Short version:

Start a new terminal and enter the following:

yum -y groupinstall basic-desktop basic-platform x11 fonts

b.) Long version:

yum -y install “Desktop” “Desktop Platform” “X Window System” “Fonts”

 

That’s it! It will work regardless the method used 😉


Posted in CentOS, Linux, Linux Installation and tagged , , , , , by with comments disabled.

How to correctly configure CUPS

 

Intro

This tutorial describes how to install a Linux print server with CUPS. It also covers the installation and configuration of printer drivers on the print server using samba share as well as the printer setup on a Windows 2000 (or higher) client

CUPS

CUPS – Common Unix Printing System is a modular printing system for unixlike computer operating system which allows a computer to act as a print-server. A computer running CUPS is a host that accept print jobs from client computers, process them and send them to the appropriate printers.

CUPS was initially developed by a guy called Michael Sweet and the protocol used back then was LPD. Due to LPD limitations and vendors incompactibility, it was replaced with IPP (internet printing protocol). CUPS was quickly adopted by various linux distributions as the default printing system. Notable among them were Red Hat Linux, Fedora, SuSE, Mandrake and in March 2002, Apple joined (using CUPS as printing system for Mac OS X 10.2). In February 2007, Apple hired chief developer Michael Sweet and purchased CUPS source code.

Now, let’s proceed with the step-bystep installing and configuring CUPS

Step #1 – Install cups service

a.) # su –

b.) # yum -y install cups

Step #2 – Configuration

a.) # vi /etc/cups/cupsd.conf

The default CUPS configuration limits access only to the local machine (cups server). If you wish to open up the access, edit /etc/cups/cupsd.conf and comment out the following lines:

Order deny, allow

Deny from all

Allow from 127.0.0.1

b.) #vi /etc/cups/cupsd.conf

I’m not sure if this is advicable but if you wish to avoid password authentication, you need to edit and comment out the following lines:

AuthType Basic

AuthClass System

These lines above restrict the printer access to system users.

Step #3 – Restart the CUPS server

# service cups restart

To be continued…


Posted in Linux, Linux Installation, samba and tagged , , by with comments disabled.

CentOS 5.8 NetInstall

Download the network installation iso file and burn to CD.

Place the CD in the CD-Rom and reboot the system.

When ask to select the network install method, choose “HTTP” and enter the following:

1) for 32 Bit
Host: mirror.centos.org
Directory: centos/5.8/os/i386

2) for 64 Bit
Host: mirror.centos.org
Directory: centos/5.8/os/x86_64


Posted in CentOS, Linux, Linux Installation and tagged , , , by with comments disabled.

CentOS 5.4 NetInstall

Download the network installation iso file and burn to CD.

Place the CD in the CD-Rom and reboot the system.

When ask to select the network install method, choose “HTTP” and enter the following:

1) for 32 Bit
Host: mirror.centos.org
Directory: centos/5.4/os/i386/

2) for 64 Bit
Host: mirror.centos.org
Directory: centos/5.4/os/x86_64/


Posted in CentOS, Linux, Linux Installation and tagged , , by with comments disabled.