Technofunction

Configuring a FTP Server on Enterprise Linux

FTP is the most commonly used for transferring of the files between the servers and computer and there are many FTP clients like filezilla which can be used to transfer file via FTP between various computers no matter which operating system is being used on it.

You might want to go through my previous post on Overview of FTP on Enterprise Linux convering all the basic details which will be used in configuring an FTP in this post.

Ensure that FTP is allowed through the firewall else SELinux is off and iptables are off. Start with installing the FTP package “vsftpd” using YUM. For creating a Yum in Enterprise Linux you may want to go through this post. You need to have root access in to configure an FTP Server.

#yum install vsftpd

(more…)

Overview of FTP in Linux

FTP is a File Transfer Protocol which helps you to download or upload your files to server securely from a remote location.

FTP uses a virtual login to server and is security enabled.

FTP is shipped in Linux with a package named “vsftpd”. You may install the vsftpd package using the yum. you might want to check my earlier post on making a local yum repository or a public yum repository.

The DAEMON i.e (Disk and execution Monitor) for FTP is /usr/sbin. Through Daemon you may start or stop the service.

Some other useful information about FTP is

Type:- system v-managed service (standalone service).

Ports:- ftp(121) and ftpdata(20)

Package:- vsftpd

Daemons:- /usr/sbin/vsftpd .

Document:- /var/ ftp/ pub

Configuration file:-

  • /etc/vsftpd/vsftpd.conf      (main configuration file)
  • /etc/vsftpd/user_list           (user list not allowed to login through ftp)
  • /etc/vsftpd/ftpuser              (Second configuration file with user list)

You would need to deselect the user e.g. root , from both the file listed above in order to login through the FTP.

Once FTP configured you may login to Remote Linux server using FTP client like filezilla.

You may login as “anonymous” user through FTP but it is not recommended. Always maintain a separate FTP user list in order to authenticate through FTP.

Formatting a Pen Drive in Centos/ RedHat Linux

You will be needing a root login or atleast root priveledge to execute the follwing commands in Linux. If you logged in as root than use following commands directly if not add “sudo” followed by the command.

Format a pen drive in Linux with the following steps:

Connect your pen drive to the system running Linux and let it get detected and mounted.  Now open a Terminal.

  • dmesg |tail : it lets you know what form of drive letters have Linux assingned to your pendrive. Remember pendrive is detected as a sata device so it starts with letter “sd” in Linux. Consider the output of following command at terminal

[root@ankit ~]# dmesg |tail

sdg: Write Protect is off
sdg: Mode Sense: 23 00 00 00
sdg: assuming drive cache: write through
SCSI device sda: 4030464 512-byte hdwr sectors (2064 MB)
sdg: Write Protect is off
sdg: Mode Sense: 23 00 00 00
sdg: assuming drive cache: write through

sdg:
sd 0:0:0:0: Attached scsi removable disk sdg
sd 0:0:0:0: Attached scsi generic sg0 type 0

Note the terms that have been shown in bold. This is the extension that Linux has assingned to your pen drive. “g” is the unique character that Linux has assingned to sata drive. The above term may differ in your system so make sure you replace the command below with the appropriate term as occur in your system.

Concept of the i-Nodes and Superblocks in Linux/Unix System

The fundamental building block of  UNIX file systems (including Linux’s ext2/ext3) is the i-node. An i-node is a control structure that points either to the other i-nodes or to data blocks.

Creation of a file system is associated with creation of data structures which contains the information about the file. Each file is assigned a unique inode number or i-number. Every file in the system is identified with the corresponding inode number.

The control information in the i-node includes the file’s owner, permissions, size, time of last access, creation time, group ID, etc. ( the entire kernel data structure is available in /usr/src/linux/include/linux/ext3_fs.h—assuming, of course, that you have the source tree installed in the /usr/src directory). A typical allocation of space alloted to inode in a file system is about 1% of the total size.

Inode number can be found using:-

$ ls -i

$ ls -l

The one thing that an i-node doesn”t  keep is the file’s name.

(more…)

Investigating And Managing Processes in Linux

In Linux the program that is running constitutes a process. In Linux two numbers are assigned to a process i.e.

  1. 1. PID (Process ID):-

The process ID is assigned by a Linux Kernel and will be unique.

  1. 2. JID (Job ID):-

The Job ID is assigned by shell and will be unique. Here again a concept a parent and child shell will be assigned and each will have its unique JOB ID in its own category.

Following command can be used in respect with processes on Linux:-

  • The command used to check the processes running in a current shell is

# ps

So it initially after you login you enter the ps command than it will show you the bash shell that you are running since you initiated it.

  • But there are processes which are running even before you login in to your account. These processes are not linked with the terminal an example of it can be send mail. You can check these processes by using “ps –ef” command an example of it is

#ps –ef | grep –i sendmail

ps-ef is already explained, (|) is used to display content page wise, “grep” is used to match the keyword here and sendmail is the process whose details we want to use.

If you simply use ps –ef command than it will list all the processes running independent of the terminal.

  • If you just want to check the process ID without much details you can use “pidof” command.

#pidof sendmail

(more…)

Ext3 file system and its advantages

The ext2 file system of Linux is a well-tested subsystem and very well optimized. Until ext3 & ext4 file system were introduced.

There are four file systems i.e : ext3, ReiserFS, XFS, and JFS. All the four of these file systems offers features that holds importance in different scenarios and needs, but the most important enhancement offered by all the four is called journaling. If we consider the Traditional file systems (such as ext2) it must search through the directory structure and find the right place on disk to lay out the data, and then lay out the data. (Linux is capable of cache the whole process of searching laying the data, including the directory updates and thereby making the process  faster to the user.)

(more…)