Pages

Thursday, January 14, 2010

Configuring vsftp Server (FTP server) in Linux ............Satish Malanch

File Transfer Protocol (FTP) is a standard network protocol used to exchange and manipulate files over a TCP/IP based network, such as the Internet. FTP is built on a client-server architecture and utilizes separate control and data connections between the client and server applications. Applications were originally interactive command-line tools with a standardized command syntax, but graphical user interfaces have been developed for all desktop operating systems in use today. FTP is also often used as an application component to automatically transfer files for program internal functions. FTP can be used with user-based password authentication or with anonymous user access.

Types of FTP

 

From a networking perspective, the two main types of FTP are active and passive. In active FTP, the FTP server initiates a data transfer connection back to the client. For passive FTP, the connection is initiated from the FTP client. These are illustrated in Figure 15-1.

Figure : Active And Passive FTP Illustrated


From a user management perspective there are also two types of FTP: regular FTP in which files are transferred using the username and password of a regular user FTP server, and anonymous FTP in which general access is provided to the FTP server using a well known universal login method.
Take a closer look at each type. 



Active FTP

The sequence of events for active FTP is:
  1. Your client connects to the FTP server by establishing an FTP control connection to port 21 of the server. Your commands such as 'ls' and 'get' are sent over this connection.


  2. Whenever the client requests data over the control connection, the server initiates data transfer connections back to the client. The source port of these data transfer connections is always port 20 on the server, and the destination port is a high port (greater than 1024) on the client.

  3. Thus the ls listing that you asked for comes back over the port 20 to high port connection, not the port 21 control connection.


FTP active mode therefore transfers data in a counter intuitive way to the TCP standard, as it selects port 20 as it's source port (not a random high port that's greater than 1024) and connects back to the client on a random high port that has been pre-negotiated on the port 21 control connection.
Active FTP may fail in cases where the client is protected from the Internet via many to one NAT (masquerading). This is because the firewall will not know which of the many servers behind it should receive the return connection.

Passive FTP

Passive FTP works differently:
  1. Your client connects to the FTP server by establishing an FTP control connection to port 21 of the server. Your commands such as ls and get are sent over that connection.


  2. Whenever the client requests data over the control connection, the client initiates the data transfer connections to the server. The source port of these data transfer connections is always a high port on the client with a destination port of a high port on the server.

Passive FTP should be viewed as the server never making an active attempt to connect to the client for FTP data transfers. Because client always initiates the required connections, passive FTP works better for clients protected by a firewall.
As Windows defaults to active FTP, and Linux defaults to passive, you'll probably have to accommodate both forms when deciding upon a security policy for your FTP server.


Configuruing FTP Server in Fedora Core 11 :

Install rpm by yum or rpm command:

[root@satish.malanchlinux.com]#cd /satishdata/install/Packages
[root@satish.malanchlinux.com Packages]#rpm –ivh –adi vsftpd*
Or
[root@satish.malanchlinux.com Packages]#yum  install  *ftp*
Start/Restart vsftpd demon:

[root@satish.malanchlinux.com]#/etc/inid/vsftpd start  
[root@satish.malanchlinux.com]#/etc/inid/vsftpd restart

With Redhat / Fedora you can configure VSFTPD to start at boot you can use the chkconfig command.

[root@satish.malanchlinux.com]# chkconfig vsftpd on

The vsftpd.conf File

VSFTPD only reads the contents of its vsftpd.conf configuration file only when it starts, so you'll have to restart VSFTPD each time you edit the file in order for the changes to take effect. The file may be located in either the /etc or the /etc/vsftpd directories depending on your Linux distribution.
This file uses a number of default settings you need to know about.
  • VSFTPD runs as an anonymous FTP server. Unless you want any remote user to log into to your default FTP directory using a username of anonymous and a password that's the same as their email address, I would suggest turning this off. The configuration file's anonymous_enable directive can be set to no to disable this feature. You'll also need to simultaneously enable local users to be able to log in by removing the comment symbol (#) before the local_enable instruction.


  • If you enable anonymous FTP with VSFTPD, remember to define the root directory that visitors will visit. This is done with the anon_root directive.


anon_root=/data/directory
  • VSFTPD allows only anonymous FTP downloads to remote users, not uploads from them. This can be changed by modifying the anon_upload_enable directive shown later.


  • VSFTPD doesn't allow anonymous users to create directories on your FTP server. You can change this by modifying the anon_mkdir_write_enable directive.


  • VSFTPD logs FTP access to the /var/log/vsftpd.log log file. You can change this by modifying the xferlog_file directive.

  • By default VSFTPD expects files for anonymous FTP to be placed in the /var/ftp directory. You can change this by modifying the anon_root directive. There is always the risk with anonymous FTP that users will discover a way to write files to your anonymous FTP directory. You run the risk of filling up your /var partition if you use the default setting. It is best to make the anonymous FTP directory reside in its own dedicated partition.


The configuration file is fairly straight forward as you can see in the snippet below where we enable anonymous FTP and individual accounts simultaneously.
# Allow anonymous FTP?
anonymous_enable=YES
...
# The directory which vsftpd will try to change
# into after an anonymous login. (Default = /var/ftp)
anon_root=/data/directory
...
# Uncomment this to allow local users to log in.
local_enable=YES
...
# Uncomment this to enable any form of FTP write command.
# (Needed even if you want local users to be able to upload files)
write_enable=YES
...
# Uncomment to allow the anonymous FTP user to upload files. This only
# has an effect if global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
...
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
...
# Activate logging of uploads/downloads.
xferlog_enable=YES
...
# You may override where the log file goes if you like.
# The default is shown below.
xferlog_file=/var/log/vsftpd.log
...
To activate or deactivate a feature, remove or add the # at the beginning of the appropriate line.

Other vsftpd.conf Options

There are many other options you can add to this file:
  • Limiting the maximum number of client connections (max_clients)


  • Limiting the number of connections by source IP address (max_per_ip)


  • The maximum rate of data transfer per anonymous login. (anon_max_rate)


  • The maximum rate of data transfer per non-anonymous login. (local_max_rate)


Descriptions on this and more can be found in the vsftpd.conf man pages.

FTP Security Issues

FTP has a number of security drawbacks, but you can overcome them in some cases. You can restrict an individual Linux user's access to non-anonymous FTP, and you can change the configuration to not display the FTP server's software version information, but unfortunately, though very convenient, FTP logins and data transfers are not encrypted.

The /etc/vsftpd.ftpusers File

For added security, you may restrict FTP access to certain users by adding them to the list of users in the /etc/vsftpd.ftpusers file. The VSFTPD package creates this file with a number of entries for privileged users that normally shouldn't have FTP access. As FTP doesn't encrypt passwords, thereby increasing the risk of data or passwords being compromised, it is a good idea to let these entries remain and add new entries for additional security.

Anonymous Upload

If you want remote users to write data to your FTP server, then you should create a write-only directory within /var/ftp/pub. This will allow your users to upload but not access other files uploaded by other users. The commands you need are:
[root@satish.malanch.com tmp]# mkdir /var/ftp/pub/upload
[root@satish.malanch.com tmp]# chmod 722 /var/ftp/pub/upload

FTP Greeting Banner

Change the default greeting banner in the vsftpd.conf file to make it harder for malicious users to determine the type of system you have. The directive in this file is.

ftpd_banner= Welcome to Satish Malnch ftp services

Client Site access :

In Windows OS you can access the ftp services by typeing ftp server address in your webbrowser:

ie. 

ftp://satish.malanch.com  or   ftp://192.168.5.20

it will prompt you for authonitaction then provide user name and password to login. 

Configuring vsftp Server (FTP server) in Linux ............Satish Malanch

File Transfer Protocol (FTP) is a standard network protocol used to exchange and manipulate files over a TCP/IP based network, such as the Internet. FTP is built on a client-server architecture and utilizes separate control and data connections between the client and server applications. Applications were originally interactive command-line tools with a standardized command syntax, but graphical user interfaces have been developed for all desktop operating systems in use today. FTP is also often used as an application component to automatically transfer files for program internal functions. FTP can be used with user-based password authentication or with anonymous user access.

Types of FTP

 

From a networking perspective, the two main types of FTP are active and passive. In active FTP, the FTP server initiates a data transfer connection back to the client. For passive FTP, the connection is initiated from the FTP client. These are illustrated in Figure 15-1.

Figure : Active And Passive FTP Illustrated


From a user management perspective there are also two types of FTP: regular FTP in which files are transferred using the username and password of a regular user FTP server, and anonymous FTP in which general access is provided to the FTP server using a well known universal login method.
Take a closer look at each type. 



Active FTP

The sequence of events for active FTP is:
  1. Your client connects to the FTP server by establishing an FTP control connection to port 21 of the server. Your commands such as 'ls' and 'get' are sent over this connection.


  2. Whenever the client requests data over the control connection, the server initiates data transfer connections back to the client. The source port of these data transfer connections is always port 20 on the server, and the destination port is a high port (greater than 1024) on the client.

  3. Thus the ls listing that you asked for comes back over the port 20 to high port connection, not the port 21 control connection.


FTP active mode therefore transfers data in a counter intuitive way to the TCP standard, as it selects port 20 as it's source port (not a random high port that's greater than 1024) and connects back to the client on a random high port that has been pre-negotiated on the port 21 control connection.
Active FTP may fail in cases where the client is protected from the Internet via many to one NAT (masquerading). This is because the firewall will not know which of the many servers behind it should receive the return connection.

Passive FTP

Passive FTP works differently:
  1. Your client connects to the FTP server by establishing an FTP control connection to port 21 of the server. Your commands such as ls and get are sent over that connection.


  2. Whenever the client requests data over the control connection, the client initiates the data transfer connections to the server. The source port of these data transfer connections is always a high port on the client with a destination port of a high port on the server.

Passive FTP should be viewed as the server never making an active attempt to connect to the client for FTP data transfers. Because client always initiates the required connections, passive FTP works better for clients protected by a firewall.
As Windows defaults to active FTP, and Linux defaults to passive, you'll probably have to accommodate both forms when deciding upon a security policy for your FTP server.


Configuruing FTP Server in Fedora Core 11 :

Install rpm by yum or rpm command:

[root@satish.malanchlinux.com]#cd /satishdata/install/Packages
[root@satish.malanchlinux.com Packages]#rpm –ivh –adi vsftpd*
Or
[root@satish.malanchlinux.com Packages]#yum  install  *ftp*
Start/Restart vsftpd demon:

[root@satish.malanchlinux.com]#/etc/inid/vsftpd start  
[root@satish.malanchlinux.com]#/etc/inid/vsftpd restart

With Redhat / Fedora you can configure VSFTPD to start at boot you can use the chkconfig command.

[root@satish.malanchlinux.com]# chkconfig vsftpd on

The vsftpd.conf File

VSFTPD only reads the contents of its vsftpd.conf configuration file only when it starts, so you'll have to restart VSFTPD each time you edit the file in order for the changes to take effect. The file may be located in either the /etc or the /etc/vsftpd directories depending on your Linux distribution.
This file uses a number of default settings you need to know about.
  • VSFTPD runs as an anonymous FTP server. Unless you want any remote user to log into to your default FTP directory using a username of anonymous and a password that's the same as their email address, I would suggest turning this off. The configuration file's anonymous_enable directive can be set to no to disable this feature. You'll also need to simultaneously enable local users to be able to log in by removing the comment symbol (#) before the local_enable instruction.


  • If you enable anonymous FTP with VSFTPD, remember to define the root directory that visitors will visit. This is done with the anon_root directive.


anon_root=/data/directory
  • VSFTPD allows only anonymous FTP downloads to remote users, not uploads from them. This can be changed by modifying the anon_upload_enable directive shown later.


  • VSFTPD doesn't allow anonymous users to create directories on your FTP server. You can change this by modifying the anon_mkdir_write_enable directive.


  • VSFTPD logs FTP access to the /var/log/vsftpd.log log file. You can change this by modifying the xferlog_file directive.

  • By default VSFTPD expects files for anonymous FTP to be placed in the /var/ftp directory. You can change this by modifying the anon_root directive. There is always the risk with anonymous FTP that users will discover a way to write files to your anonymous FTP directory. You run the risk of filling up your /var partition if you use the default setting. It is best to make the anonymous FTP directory reside in its own dedicated partition.


The configuration file is fairly straight forward as you can see in the snippet below where we enable anonymous FTP and individual accounts simultaneously.
# Allow anonymous FTP?
anonymous_enable=YES
...
# The directory which vsftpd will try to change
# into after an anonymous login. (Default = /var/ftp)
anon_root=/data/directory
...
# Uncomment this to allow local users to log in.
local_enable=YES
...
# Uncomment this to enable any form of FTP write command.
# (Needed even if you want local users to be able to upload files)
write_enable=YES
...
# Uncomment to allow the anonymous FTP user to upload files. This only
# has an effect if global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
...
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
...
# Activate logging of uploads/downloads.
xferlog_enable=YES
...
# You may override where the log file goes if you like.
# The default is shown below.
xferlog_file=/var/log/vsftpd.log
...
To activate or deactivate a feature, remove or add the # at the beginning of the appropriate line.

Other vsftpd.conf Options

There are many other options you can add to this file:
  • Limiting the maximum number of client connections (max_clients)


  • Limiting the number of connections by source IP address (max_per_ip)


  • The maximum rate of data transfer per anonymous login. (anon_max_rate)


  • The maximum rate of data transfer per non-anonymous login. (local_max_rate)


Descriptions on this and more can be found in the vsftpd.conf man pages.

FTP Security Issues

FTP has a number of security drawbacks, but you can overcome them in some cases. You can restrict an individual Linux user's access to non-anonymous FTP, and you can change the configuration to not display the FTP server's software version information, but unfortunately, though very convenient, FTP logins and data transfers are not encrypted.

The /etc/vsftpd.ftpusers File

For added security, you may restrict FTP access to certain users by adding them to the list of users in the /etc/vsftpd.ftpusers file. The VSFTPD package creates this file with a number of entries for privileged users that normally shouldn't have FTP access. As FTP doesn't encrypt passwords, thereby increasing the risk of data or passwords being compromised, it is a good idea to let these entries remain and add new entries for additional security.

Anonymous Upload

If you want remote users to write data to your FTP server, then you should create a write-only directory within /var/ftp/pub. This will allow your users to upload but not access other files uploaded by other users. The commands you need are:
[root@satish.malanch.com tmp]# mkdir /var/ftp/pub/upload
[root@satish.malanch.com tmp]# chmod 722 /var/ftp/pub/upload

FTP Greeting Banner

Change the default greeting banner in the vsftpd.conf file to make it harder for malicious users to determine the type of system you have. The directive in this file is.

ftpd_banner= Welcome to Satish Malnch ftp services

Client Site access :

In Windows OS you can access the ftp services by typeing ftp server address in your webbrowser:

ie. 

ftp://satish.malanch.com  or   ftp://192.168.5.20

it will prompt you for authonitaction then provide user name and password to login. 

Thursday, January 07, 2010

Some New and Great Features in Fedora 11

Hi Friends,

In this artical i am going to mention some to the new cool and robust featue of Red Hat Fedora core 11.

1. Booting Time :
                             Boot time in this edition is minimum ever.With default software Packages in GNome session the booting time in between boot screen to login screen in less than 20 sec
( In init-5, in Init3 terminal is even fast ).

2.ABRT:
                  Automatic Bug Reporting Tool: Help non-power users with bug reporting, making it as easy as a few mouse clicks.

 3. ext4 file System:

Make ext4 the default files system for anaconda-driven installs (replacing ext3). User should notice generally better performance, and benefit from things like persistent preallocation when using updated torrent clients, etc.Risk of data lose are very less in this file system. GRUB still does not offer Ext4 support under Fedora.
4. Better Surfing with Mozila Firefox 3.5:
                                                                 Firefox has been upgraded to version 3.5 .
5. Gnome Version 2.26
6. KDE Desktop version KDE 4.2
7. Tiger VNC : Tiger VNC is new tool for Remote support

Some New and Great Features in Fedora 11

Hi Friends,

In this artical i am going to mention some to the new cool and robust featue of Red Hat Fedora core 11.

1. Booting Time :
                             Boot time in this edition is minimum ever.With default software Packages in GNome session the booting time in between boot screen to login screen in less than 20 sec
( In init-5, in Init3 terminal is even fast ).

2.ABRT:
                  Automatic Bug Reporting Tool: Help non-power users with bug reporting, making it as easy as a few mouse clicks.

 3. ext4 file System:

Make ext4 the default files system for anaconda-driven installs (replacing ext3). User should notice generally better performance, and benefit from things like persistent preallocation when using updated torrent clients, etc.Risk of data lose are very less in this file system. GRUB still does not offer Ext4 support under Fedora.
4. Better Surfing with Mozila Firefox 3.5:
                                                                 Firefox has been upgraded to version 3.5 .
5. Gnome Version 2.26
6. KDE Desktop version KDE 4.2
7. Tiger VNC : Tiger VNC is new tool for Remote support

Wednesday, December 30, 2009

Unable to login on Fedora 11 with root user in GUI

I just install linux ( Fedora core -11) after interval of more than 6 months. Just installed Fedora core 11, surprisely there was one more option to create file sytem ext4 ,this file system was new for me.
Now as i finished installation ooooooooooooopsss
I was'nt able to login in GUI as super user. System refelect an error "unable to authoneticate"
Finaly after a littel bit R & D i got solution.Here it is:
 Fedora 10 and above uses pam module called pam_succeed_if.so. This module is designed to succeed or fail authentication based on characteristics of the account belonging to the user being authenticated. One use is to select whether to load other modules based on this test. This module blocks root login using GUI.
to fix this problem


Login as a normal user and open terminal
now give command



[satish@malanch.com]$su

Type your root password. Next, make a backup of /etc/pam.d/gdm, enter:


[root@malanch.com]#cp /etc/pam.d/gdm /root

Now open /etc/pam.d/gdm using gedit or vi text editor, enter:





[root@malanch.com]#vim  /etc/pam.d/gdm

Alternatively, you can do everything in a one command:



su -c 'gedit /etc/pam.d/gdm

Find line that read as follows:



auth required pam_succeed_if.so user != root quiet
Remove or comment out line by prefixing #.



# auth required pam_succeed_if.so user != root quiet

Save and close the file. Logout from terminal and from GUI itself.
now restart ur machine by init 6.
Now you can login to your sytem in GUI with root user. (only in case of Fedora 10)

In case of Fedora 11 you need to edit one more file which is located in /etc/pam.d/gdm-password

[root@malanch.com]#vim /etc/pam.d/gdm-password

Find line that read as follows:


auth required pam_succeed_if.so user != root quiet



Remove or comment out line by prefixing #.




Now restart and enjoy login with root.


                                                                ... Satish Malanch
                                                                     
satishmalanch@gmail.com

Unable to login on Fedora 11 with root user in GUI

I just install linux ( Fedora core -11) after interval of more than 6 months. Just installed Fedora core 11, surprisely there was one more option to create file sytem ext4 ,this file system was new for me.
Now as i finished installation ooooooooooooopsss
I was'nt able to login in GUI as super user. System refelect an error "unable to authoneticate"
Finaly after a littel bit R & D i got solution.Here it is:
 Fedora 10 and above uses pam module called pam_succeed_if.so. This module is designed to succeed or fail authentication based on characteristics of the account belonging to the user being authenticated. One use is to select whether to load other modules based on this test. This module blocks root login using GUI.
to fix this problem


Login as a normal user and open terminal
now give command



[satish@malanch.com]$su

Type your root password. Next, make a backup of /etc/pam.d/gdm, enter:


[root@malanch.com]#cp /etc/pam.d/gdm /root

Now open /etc/pam.d/gdm using gedit or vi text editor, enter:





[root@malanch.com]#vim  /etc/pam.d/gdm

Alternatively, you can do everything in a one command:



su -c 'gedit /etc/pam.d/gdm

Find line that read as follows:



auth required pam_succeed_if.so user != root quiet
Remove or comment out line by prefixing #.



# auth required pam_succeed_if.so user != root quiet

Save and close the file. Logout from terminal and from GUI itself.
now restart ur machine by init 6.
Now you can login to your sytem in GUI with root user. (only in case of Fedora 10)

In case of Fedora 11 you need to edit one more file which is located in /etc/pam.d/gdm-password

[root@malanch.com]#vim /etc/pam.d/gdm-password

Find line that read as follows:


auth required pam_succeed_if.so user != root quiet



Remove or comment out line by prefixing #.




Now restart and enjoy login with root.


                                                                ... Satish Malanch
                                                                     
satishmalanch@gmail.com

Wednesday, December 23, 2009

Download Kat MP3 Recorder

Kat MP3 Recorder adalah sebuah program yang memungkinkan rekaman audio pada PC Anda, dari aplikasi apapun seperti radio online, atau dari perangkat apapun, seperti mikrofon untuk merekam percakapan, karaoke, atau pengisi suara.

Anda dapat merekam dari TV tuner,juga dari sebuah DVD, dari game, dari halaman web, dll.


Aplikasi ini mendukung multiple audio format: MP3, WAV, WMA, OGG, VOX, AIFF dan

Download Kat MP3 Recorder

Kat MP3 Recorder adalah sebuah program yang memungkinkan rekaman audio pada PC Anda, dari aplikasi apapun seperti radio online, atau dari perangkat apapun, seperti mikrofon untuk merekam percakapan, karaoke, atau pengisi suara.

Anda dapat merekam dari TV tuner,juga dari sebuah DVD, dari game, dari halaman web, dll.


Aplikasi ini mendukung multiple audio format: MP3, WAV, WMA, OGG, VOX, AIFF dan

Tuesday, December 22, 2009

2010 Security Suites: The Best and Worst

We've reviewed nearly a dozen 2010 security suites�find out which will keep you safe and which to avoid.

The 2010 "model year" for security suites got started early, with a couple of products already out in June. Panda Internet Security 2010 made a decent showing, but eScan Internet Security Suite for Home Users Version 10 isn't ready to provide serious competition for any of the better-known contenders in the U.S. market. Much the same is true of K7 TotalSecurity Version 10.0: It's popular in Japan, but doesn't live up to the standards set by other major products here�at least it didn't bog down my test systems. Through the summer the suites kept rolling in, keeping me busy with all-out evaluations. Read More....

Direct Source Link: http://www.pcmag.com/article2/0,2817,2351871,00.asp

Monday, December 14, 2009

Online Safety | Antivirus Software | Internet Security Software | Security Tips

Antivirus Software and Safe Online Behaviour - 2010 Outlook
� There has been lots and lots of computer users who became victims of viruses, spyware, worm, and trojan attacks in 2009. Also to point out there are security sites itself has been hacked, computer viruses has been floating around over the internet and many other known and unkwown events that happened. How is going to be the future? What steps are to be taken to protect from such internet security threats? are the points here to be discussed.