Saturday, July 10, 2010

Using Sendmail to Relay Mails from Your MSP/ISP in Centos, RHEL, Ubuntu and Other Linux Distros

Do you want to relay mails from your local sendmail server to your ISP. Just follow the below steps

Open sendmail.mc using default editor vi, edit, emacs
# vi /etc/mail/sendmail.mc

define(`SMART_HOST',`[smtp.yourisphost.com]')
FEATUREdnl

Save the File and exit
Open the File authinfo (If not Present Create a New File).


vi /etc/mail/authinfo
Add the following Line
"AuthInfo:smtp.yourisphost.com "U:UsernamefromISP" "P:passwordfromISP" "M:LOGIN PLAIN"

Save the File and Exit

Just run the below commands to recreate the sendmail.cf file

# cd /etc/mail/
# m4 sendmail.mc > sendmail.cf

Make Map will recreate the database for authinfo to be used in sendmail

# makemap hash /etc/mail/authinfo < /etc/mail/authinfo

Restart the Sendmail Service and check if All's Good !!!

# /etc/init.d/sendmail restart


echo '/map authinfo AuthInfo:smtp.yourisphost.com' | /usr/sbin/sendmail -bt



Sent Mail Check in Logs

Enjoy.....

Comment if issues or modification required.

Finding First Instance of the Pattern Using Grep in Linux

Grep in Linux
Have you ever faced a problem grepping (Parsing) for a pattern from a file, Definately being a Linux Administrator you have done it several times but have you came across a situation where from a huge file you only have to parse the first instance of the pattern, grepping the whole file for a pattern will be tedious and will be using more system resources especially when you are doing it using a script (Using Loop for, while, until)

The easy solution to tackle the problem is to use grep with inbuilt option which will display only the first instances instead of checking the whole file and than printing the first line using head command.


Command :
grep -m 1 "pattern" filename.txt


The "-m" option when passed with grep will search for the first matching pattern from the file and print the output same-way if you want to look for first 2 instances pass option "grep -m 2 "pattern" yourfilename.log"

Enjoy...

Friday, July 9, 2010

Blocking Specific Sender to Specific Recipient or IPs Spamming Using Sendmail in Linux

Maintaining a MailServer is really a all time headache for Mail Server Admins, specifically to prevent SPAM relayed from you Server or delivered to your server.

In this article we would use some inbuilt feature of Sendmail to block users from sending mail to specific users or domains, this can be attained in many ways but i have done it in the below manner. For any issues please comment at the bottom of the post.

Sendmail is Oldest Mail transfer agent used by major of the MSP's (Mail Service Providers) all over the world, with its huge forum, mailing list and IRC Support and help it has gained high name within its competitors.

When Do i need to block a user or IP?
Reasons Are Many
1. Spamming done from your domain.
2. Spamming happening from outside to your server.
3. Spamming from a particular IP.
4. Wants to reject relaying mail for a user (Used incase allowed to just fetch mails, no sending allowed)
5. Any Many More...........

To block the user or IP we will be using access file / database included in the sendmail, Access Database provides a single, central database with rules to accept, reject, and discard messages based on the sender name, address, or IP number. It is enabled with the access_db configuration feature.

1. Enable the Access Database in Sendmail
You have to make add or declare the following lines in your sendmail.mc file

FEATURE(`access_db')

The above line added in the sendmail.mc enables use of the access database, and enables the default database type and path as:

hash /etc/mail/access

2. Create the access Database
Edit the File /etc/mail/access, the entries should be inorder

key value

The lefthand column is the key which is composed of a prefix and an address expression, this can contain hostname, email address, IP address, networks etc

The righthand column contains the value, which can be keywords or values that determine what should be done with the item described on the left or in a layman langauge the action to be executed, the preferable values are OK, RELAY, REJECT, DISCARD, SKIP, ERROR:XYZ text.

Eg :

spam@goo.gle.com REJECT
10.0.0.35 REJECT
192.168.1.100/255.0.0.0 REJECT
From:spammer@somedomain.com REJECT
To:trusteddomain.org RELAY
Connect:2trusteddomain.com OK
Connect:ashwin.com RELAY
From:good@domain.com OK
From:anotherbaddomain.com REJECT

To be able to block specific sender to specific recipient you need to add the following line in sendmail.mc to enable compat.
FEATURE(`check_compat')


Then make the following entries in access file (Location : /etc/mail/access)

Compat:extsender@mydomain.com<@>recipient@outdomain.com DISCARD


After confirming all the entries as per your requirement in access file, we have to recreate the access in hash database for which execute the below command

cd /etc/mail

makemap hash access < access

m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf


Restart the sendmail service
/etc/init.d/sendmail restart


Testing

telnet to_your_mailserver_ip 25
mail from:internaluser@example.com
Ok
rcpt to:spam@goo.gle.com
REJECTED


Enjoy..

Thursday, July 8, 2010

Packet Capturing and Analayzing packets Using TCPDUMP on Centos, Fedora, Ubuntu and other Linux Distros

Many a times Linux System Admin2 face problem in network latency, connectivity the servers hampers the services which impact to the business. Using linux basic tools can not really solve it but you can identify the issues faced by the host to host or host to the device.

Here we will be using tcpdump tool to capture packet after which you can analyse the data and conclude with errors host.
If you have installed linux properly tcpdump is by default installed on to your system, and if not you can install it finding the relevant packages for your distros

RPM Based Linux can google for "tcpdump +rpm" and Debian can google for "tcpdump +deb", you will get enough results to finish installing the TCPDUMP package onto your system.

After installing, check if tcpdump is installed successfully executing the below command

 #>which tcpdump


Should return the binary location of the package installed

/usr/sbin/tcpdump


After confirming you can run tcpdump with various options passing to the command to check for the options

[root@ashwin ~]# tcpdump --help
tcpdump version 3.9.8
libpcap version 0.9.8
Usage: tcpdump [-aAdDeflLnNOpqRStuUvxX] [-c count] [ -C file_size ]
[ -E algo:secret ] [ -F file ] [ -i interface ] [ -M secret ]
[ -r file ] [ -s snaplen ] [ -T type ] [ -w file ]
[ -W filecount ] [ -y datalinktype ] [ -Z user ]
[ expression ]


We will be capturing packets for 2 minutes and analyze for any issues with hosts connecting to and from.

Running the below command will capture all the packets transferring between the hosts through the Network Interface Cards and will be redirected to a file

tcpdump -n -i bond0 -e -vvv > output.log


Once you have captured packets for 5 minutes press Ctrl + z to end and proceed with analyzing the file "output.log"


Example :

2.39.omserv > 11.240.240.141.nfs: ., cksum 0x1eba (correct), 156:156(0) ack 28961 win 30782
18:41:21.397883 00:a0:98:10:7a:05 > 00:21:5a:4c:a6:3e, ethertype IPv4 (0x0800), length 1514: (tos 0x0, ttl 64, id 26738, offset 0, flags [DF], proto: TCP (6), length: 1500) 11.240.240.141.2049 > 11.240.240.39.33554432: reply ERR 1448

In the above line its clear that a partition is mounted on the host using NFS protocol from other hosts having IP 11.240.240.141 which is having issues while transferring data to host bearing IP 11.240.240.39 Error "reply ERR 1448"

You can find great detail in the output of tcpdump, Also you can use wireshark to read the output.txt and get a better clarity of the data transmission hence lot of network latency can be resolved.

Enjoy.

Packet Capturing and Analayzing packets Using TCPDUMP on Centos, Fedora, Ubuntu and other Linux Distros

Tuesday, June 29, 2010

Solved : Lock table is out of available locker entries - Yum install, yum upgrade

Recently faced a issue while installing a package using yum


[root@back ~]# yum install mod-security
rpmdb: Lock table is out of available locker entries
rpmdb: Unknown locker ID: 3077
error: db4 error(22) from db->close: Invalid argument
error: cannot open Packages index using db3 - Cannot allocate memory (12)
error: cannot open Packages database in /var/lib/rpm
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in ?
yummain.main(sys.argv[1:])
File "/usr/share/yum-cli/yummain.py", line 85, in main
base.getOptionsConfig(args)
File "/usr/share/yum-cli/cli.py", line 163, in getOptionsConfig
disabled_plugins=self.optparser._splitArg(opts.disableplugins))
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 164, in _getConfig
self._conf = config.readMainConfig(startupconf)
File "/usr/lib/python2.4/site-packages/yum/config.py", line 685, in readMainConfig
yumvars['releasever'] = _getsysver(startupconf.installroot, startupconf.distroverpkg)
File "/usr/lib/python2.4/site-packages/yum/config.py", line 752, in _getsysver
idx = ts.dbMatch('provides', distroverpkg)
TypeError: rpmdb open failed


Googling and Searching on this topic got it resolved

[root@back ~]# ll /var/lib/rpm/
Basenames __db.000 __db.002 Dirnames Group Name Providename Pubkeys Requireversion Sigmd5
Conflictname __db.001 __db.003 Filemd5s Installtid Packages Provideversion Requirename Sha1header Triggername
[root@back ~]# ll /var/lib/rpm/
Basenames __db.000 __db.002 Dirnames Group Name Providename Pubkeys Requireversion Sigmd5
Conflictname __db.001 __db.003 Filemd5s Installtid Packages Provideversion Requirename Sha1header Triggername


[root@back ~]# rm /var/lib/rpm/_db.00*
rm: cannot lstat `/var/lib/rpm/_db.00*': No such file or directory
[root@back ~]# rm /var/lib/rpm/__db.00*
rm: remove regular empty file `/var/lib/rpm/__db.000'? y
rm: remove regular file `/var/lib/rpm/__db.001'? y
rm: remove regular file `/var/lib/rpm/__db.002'? y
rm: remove regular file `/var/lib/rpm/__db.003'? y

[root@back ~]# rpm --rebuilddb


[root@back ~]# yum install mod-security
utterramblings 100% |=========================| 951 B 00:00
primary.xml.gz 100% |=========================| 22 kB 00:00
utterrambl: ################################################## 64/64
extras 100% |=========================| 2.1 kB 00:00
primary.sqlite.bz2 100% |=========================| 184 kB 00:38
updates 100% |=========================| 1.9 kB 00:00
primary.sqlite.bz2 100% |=========================| 254 kB 00:28
base 100% |=========================| 2.1 kB 00:00
primary.sqlite.bz2 100% |=========================| 1.6 MB 00:17
c5-testing 100% |=========================| 1.9 kB 00:00
addons 100% |=========================| 951 B 00:00
Setting up Install Process
Parsing package install arguments
No package mod-security available.
Nothing to do
[root@back ~]# yum install mod_security
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package mod_security.i386 0:2.5.9-1.jason.1 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
mod_security i386 2.5.9-1.jason.1 utterramblings 1.2 M

Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 1.2 M
Is this ok [y/N]: y
Downloading Packages:
(1/1): mod_security-2.5.9 100% |=========================| 1.2 MB 00:03
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 0d4306ef
Importing GPG key 0x0D4306EF "Jason Litka (http://www.jasonlitka.com) " from http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: mod_security ######################### [1/1]

Installed: mod_security.i386 0:2.5.9-1.jason.1
Complete!


This problem occurs when rpm accesses the Berkeley database files, it makes temporary locker entries within the tables while it searches for data. If you control-c your rpm processes often, this issue will occur much sooner because the locks are never cleared.

Solved Lock table is out of available locker entries - Yum install, yum upgrade

Solved : Lock table is out of available locker entries - Yum install, yum upgrade

Recently faced a issue while installing a package using yum
[root@back ~]# yum install mod-security
rpmdb: Lock table is out of available locker entries
rpmdb: Unknown locker ID: 3077
error: db4 error(22) from db->close: Invalid argument
error: cannot open Packages index using db3 - Cannot allocate memory (12)
error: cannot open Packages database in /var/lib/rpm
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in ?
yummain.main(sys.argv[1:])
File "/usr/share/yum-cli/yummain.py", line 85, in main
base.getOptionsConfig(args)
File "/usr/share/yum-cli/cli.py", line 163, in getOptionsConfig
disabled_plugins=self.optparser._splitArg(opts.disableplugins))
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 164, in _getConfig
self._conf = config.readMainConfig(startupconf)
File "/usr/lib/python2.4/site-packages/yum/config.py", line 685, in readMainConfig
yumvars['releasever'] = _getsysver(startupconf.installroot, startupconf.distroverpkg)
File "/usr/lib/python2.4/site-packages/yum/config.py", line 752, in _getsysver
idx = ts.dbMatch('provides', distroverpkg)
TypeError: rpmdb open failed

Googling and Searching on this topic got it resolved
[root@back ~]# ll /var/lib/rpm/
Basenames __db.000 __db.002 Dirnames Group Name Providename Pubkeys Requireversion Sigmd5
Conflictname __db.001 __db.003 Filemd5s Installtid Packages Provideversion Requirename Sha1header Triggername
[root@back ~]# ll /var/lib/rpm/
Basenames __db.000 __db.002 Dirnames Group Name Providename Pubkeys Requireversion Sigmd5
Conflictname __db.001 __db.003 Filemd5s Installtid Packages Provideversion Requirename Sha1header Triggername

[root@back ~]# rm /var/lib/rpm/_db.00*
rm: cannot lstat `/var/lib/rpm/_db.00*': No such file or directory
[root@back ~]# rm /var/lib/rpm/__db.00*
rm: remove regular empty file `/var/lib/rpm/__db.000'? y
rm: remove regular file `/var/lib/rpm/__db.001'? y
rm: remove regular file `/var/lib/rpm/__db.002'? y
rm: remove regular file `/var/lib/rpm/__db.003'? y

[root@back ~]# rpm --rebuilddb

[root@back ~]# yum install mod-security

utterramblings 100% |=========================| 951 B 00:00

primary.xml.gz 100% |=========================| 22 kB 00:00

utterrambl: ################################################## 64/64

extras 100% |=========================| 2.1 kB 00:00

primary.sqlite.bz2 100% |=========================| 184 kB 00:38

updates 100% |=========================| 1.9 kB 00:00

primary.sqlite.bz2 100% |=========================| 254 kB 00:28

base 100% |=========================| 2.1 kB 00:00

primary.sqlite.bz2 100% |=========================| 1.6 MB 00:17

c5-testing 100% |=========================| 1.9 kB 00:00

addons 100% |=========================| 951 B 00:00

Setting up Install Process

Parsing package install arguments

No package mod-security available.

Nothing to do

[root@back ~]# yum install mod_security

Setting up Install Process

Parsing package install arguments

Resolving Dependencies

--> Running transaction check

---> Package mod_security.i386 0:2.5.9-1.jason.1 set to be updated

--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================

Package Arch Version Repository Size

=============================================================================

Installing:

mod_security i386 2.5.9-1.jason.1 utterramblings 1.2 M
Transaction Summary

=============================================================================

Install 1 Package(s)

Update 0 Package(s)

Remove 0 Package(s)
Total download size: 1.2 M

Is this ok [y/N]: y

Downloading Packages:

(1/1): mod_security-2.5.9 100% |=========================| 1.2 MB 00:03

warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 0d4306ef

Importing GPG key 0x0D4306EF "Jason Litka (http://www.jasonlitka.com) " from http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka

Is this ok [y/N]: y

Running rpm_check_debug

Running Transaction Test

Finished Transaction Test

Transaction Test Succeeded

Running Transaction

Installing: mod_security ######################### [1/1]
Installed: mod_security.i386 0:2.5.9-1.jason.1

Complete!

This problem occurs when rpm accesses the Berkeley database files, it makes temporary locker entries within the tables while it searches for data. If you control-c your rpm processes often, this issue will occur much sooner because the locks are never cleared.

Saturday, June 5, 2010

How to Install Mod Security on Linux Centos 5.4, Fedora 11-12

ModSecurity is a free open source Firewall for Web application which can help you to guard against Intrusion on your webservers like local file inclusion attacks, Cross Site Scripting, and SQL injection vulnerabilities and many more.

The easiest way to install mod_security is using yum, to get the latest package of modsecurity refer to jason litka rpms.
Lets Start

Install the gpg Key

You need to be Root to run this:

[ashwin@ashwin ~]$ rpm –import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka


Create a File

[ashwin@ashwin ~]$ touch /etc/yum.repos.d/utterramblings.repo

Open the File using your favorite editor and add the contents

[ashwin@ashwin ~]$ vim /etc/yum.repos.d/utterramblings.repo

[utterramblings]
name=Jason’s Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka

Save the File and exit

Now you can Install Mod-Security

[root@ashwin ~]# yum install mod_security
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package mod_security.i386 0:2.5.9-1.jason.1 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
mod_security            i386       2.5.9-1.jason.1  utterramblings    1.2 M

Transaction Summary
=============================================================================
Install      1 Package(s)
Update       0 Package(s)
Remove       0 Package(s)

Total download size: 1.2 M
Is this ok [y/N]: y
Downloading Packages:
(1/1): mod_security-2.5.9 100% |=========================| 1.2 MB    00:03
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 0d4306ef
Importing GPG key 0x0D4306EF "Jason Litka (http://www.jasonlitka.com) <jasonlitka@verizon.net>" from http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: mod_security                 ######################### [1/1]

Installed: mod_security.i386 0:2.5.9-1.jason.1
Complete!

Great You have installed mod security Restart HTTPD service and Roll. Check the Logs and you will find the magic.

Issues :

1. Starting httpd: httpd: Syntax error on line 210 of /etc/httpd/conf/httpd.conf: Syntax error on line 3 of /etc/httpd/conf.d/mod_security.conf: Cannot load /etc/httpd/modules/mod_security2.so into server: /etc/httpd/modules/mod_security2.so: undefined symbol: ap_get_server_banner

Solution :

[root@ashwin ~]#  yum remove httpd mod_perl mod_perl-devel mod_security
[root@ashwin ~]#  mv /etc/yum.repos.d/CentOS-Base.repo /tmp ( move base centos repo to /tmp )
[root@ashwin ~]#  yum install httpd ( This will install apache from utterramblings.repo )
[root@ashwin ~]#  yum install mod_perl mod_perl-devel
[root@ashwin ~]#  yum install mod_security

Sunday, May 9, 2010

Step by Step Installing mod_security from Source in Linux Centos5.4, Fedora12 Howto

To Install mod Security from the source go to the Website of Mod security and download the packages
[superuser@ashwin modse]# get http://www.modsecurity.org/download/modsecurity-apache_2.5.12.tar.gz

–2010-05-05 15:19:12– http://www.modsecurity.org/download/modsecurity-apache_2.5.12.tar.gz

Saving to: `modsecurity-apache_2.5.12.tar.gz’

100%[=======================================>] 1,392,209 1235.9Mb/s in 5s

2010-05-05 15:19:18 (1235.7 MB/s) – `modsecurity-apache_2.5.12.tar.gz’ saved [1392209/1392209]

[superuser@ashwin modse]# tar -zxf modsecurity-apache_2.5.

To see the Full Tutorial:

Step by Step Installing mod_security from Source in Linux Centos5.4, Fedora12 Howto

Thursday, May 6, 2010

Howto Add New User, New Group and modify Users, Groups in Linux - Centos5.4, Fedora 11 - Part 1

Adding users in Linux helps you from giving all user Administrative (root access) rights if the system is used by Multiple people. Its one of the basic command but still very important which need to studied in much details, The More detail you know about adding user and adding group modifying existing users and groups may lead with excellent system administration skills and also help you with securing system. There are many attributes to read when we learn about useradd and groupadd command in linux. In this article we will go indepth of Adding, Modifying User and groups and also discussing about various parameters while using these commands.

Adding New User in Linux

Adding a new user to your linuxbox is as simple as running a command with a argument which is the username to be created

[root@ashwin ~]# useradd ashwin


Great You have created a new user but now into the technical details how does the user gets the home directory, how is the UID,GID set, how the default shell is assigned and other different features gets assigned when addding a user.

When you add a user immediately some files are checked if the user is already present Files

1. /etc/passwd
2. /etc/groups
3. /etc/shadows

If the user is not present in the above 3 files the next step is to look for another set of files which by default assign values to a newly added user the file which is looked is
 # cat /etc/login.defs 


The above file contains all the default parameter like, UID, GID to be set for new user, Home Directory (If not specified explicitly). Now once the user is added the home directory is created in /home/username by default and assigned a unique UID,GID. When you see the contents of /home/username you will find files

[ashwin@ashwin ~]$ ll -a /home/ashwin/
-rw-r--r--. 1 root root 18 2009-04-08 16:16 .bash_logout
-rw-r--r--. 1 root root 176 2009-04-08 16:16 .bash_profile
-rw-r--r--. 1 root root 124 2009-04-08 16:16 .bashrc
-rw-r--r--. 1 root root 500 2009-04-10 17:22 .emacs
drwxr-xr-x. 2 root root 4096 2009-03-18 06:22 .gnome2
drwxr-xr-x. 4 root root 4096 2010-03-19 12:20 .mozilla
-rw-r--r--. 1 root root 658 2009-03-02 22:50 .zshrc

Now from where these files came from, yes this files are copied to every newly added user from the /etc/skel folder.


[ashwin@ashwin ~]$ ll -a /etc/skel/
-rw-r--r--. 1 root root 18 2009-04-08 16:16 .bash_logout
-rw-r--r--. 1 root root 176 2009-04-08 16:16 .bash_profile
-rw-r--r--. 1 root root 124 2009-04-08 16:16 .bashrc
-rw-r--r--. 1 root root 500 2009-04-10 17:22 .emacs
drwxr-xr-x. 2 root root 4096 2009-03-18 06:22 .gnome2
drwxr-xr-x. 4 root root 4096 2010-03-19 12:20 .mozilla
-rw-r--r--. 1 root root 658 2009-03-02 22:50 .zshrc


Now a Bit more depth on useradd, we'll now discuss some parameters while adding a new user to change the default home directory, UID, GID, Default Shell Login, Password

The Following arguments can be used to the command useradd

-b, --base-dir BASE_DIR base directory for the new user account
home directory
-c, --comment COMMENT set the GECOS field for the new user account
-d, --home-dir HOME_DIR home directory for the new user account
-D, --defaults print or save modified default useradd
configuration
-e, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE
-f, --inactive INACTIVE set password inactive after expiration to INACTIVE
-g, --gid GROUP force use GROUP for the new user account
-G, --groups GROUPS list of supplementary groups for the new user account
-h, --help display this help message and exit
-k, --skel SKEL_DIR specify an alternative skel directory
-K, --key KEY=VALUE overrides /etc/login.defs defaults
-l, do not add the user to the lastlog and faillog databases
-m, --create-home create home directory for the new user account
-M, do not create user's home directory(overrides /etc/login.defs)
-N, --no-user-group do not create a group with the same name as the user
-o, --non-unique allow create user with duplicate (non-unique) UID
-p, --password PASSWORD use encrypted password for the new user account
-r, --system create a system account
-s , --shell SHELL the login shell for the new user account
-u, --uid UID force use the UID for the new user account
-U, --user-group create a group with the same name as the user
-Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user mapping



    Examples


1. Add user with home directory in /opt/username

[root@ashwin ~]# useradd -d /opt/ username

2. Add user with defined home directory UID, GID

[root@ashwin ~]# useradd -d /opt/ -u 800 -g 800 username


3. Defining password while adding a new user

[root@ashwin ~]# useradd -d /opt/ -u 800 -g 800 -p password username

4. Defining the login shell for the new user account

[root@ashwin ~]# useradd -d /opt/ -u 800 -g 800 -p password -s /bin/sh username

[root@ashwin ~]# useradd -d /opt/ -u 800 -g 800 -p password -s /bin/nologin username

Explore around with the parameters you would find many features in it.

Also Look For Parts Two to know more depth knowledge of User and Group adding in Linux

Wednesday, May 5, 2010

Step by Step Installing mod_security from Source in Linux Centos5.4, Fedora12 Howto

To Install mod Security from the source go to the Website of Mod security and download the packages
[superuser@ashwin modse]# get http://www.modsecurity.org/download/modsecurity-apache_2.5.12.tar.gz

--2010-05-05 15:19:12-- http://www.modsecurity.org/download/modsecurity-apache_2.5.12.tar.gz

Saving to: `modsecurity-apache_2.5.12.tar.gz'

100%[=======================================>] 1,392,209 1235.9Mb/s in 5s

2010-05-05 15:19:18 (1235.7 MB/s) - `modsecurity-apache_2.5.12.tar.gz' saved [1392209/1392209]

[superuser@ashwin modse]# tar -zxf modsecurity-apache_2.5.12.tar.gz
[superuser@ashwin modse]# cd modsecurity-apache_2.5.12

Stop Apache httpd
[superuser@ashwin modse]# service httpd stop
[superuser@ashwin apache2]# /configure --with-apxs=/path/to/httpd-2.x.y/bin/apxs

Compile with:
[superuser@ashwin apache2]# make

Optionally test with:
[superuser@ashwin apache2]# make test

Optionally build the ModSecurity Log Collector with:
[superuser@ashwin apache2]# make mlogc

Install the ModSecurity module with:
[superuser@ashwin apache2]# make install

If you get the below error you need to recompile apache with DSO and APXS

configure: looking for Apache module support via DSO through APXS
configure: error: couldn't find APXS

Solution
[superuser@ashwin modse]# get http://apache.siamwebhosting.com/httpd/httpd-2.2.15.tar.gz
[superuser@ashwin modse]# cd httpd-2.2.15
[superuser@ashwin httpd-2.2.15]# ./configure --enable-so --with-pcre
[superuser@ashwin httpd-2.2.15]# make
[superuser@ashwin httpd-2.2.15]# make install

Now Change you directory to /your/path/mod-security/apache2/
Install MOD-Security
[superuser@ashwin apache2]# make install

Congratulation you have successfully installed mod-security now to make it work add the following lines in your apache configuration file
[superuser@ashwin apache2]# vi /etc/httpd/conf/httpd.conf
LoadFile /usr/lib/libxml2.so
LoadFile /usr/lib/liblua5.1.so

# Load the ModSecurity module with:
LoadModule security2_module modules/mod_security2.so

Now Restart Apache Service and you ready to Go
superuser@ashwin apache2]# service httpd start

Thursday, April 15, 2010

Email Marketing In India - How Do I Choose One from Many

Email Marketing In India




As the name say Email used for marketing communications. it is nothing but broadcasting of emails to the general public who can be potential customer or are already your customers.In this article we'll discuss Emailing Marketing in India.

India being the quickest revenue generating country for a new product launch and also being the HIGHEST ROI (Return on Investment) country entrepreneurs have kept an eagles eye launching their product/services publicly. As computer reach in India increased a lot in the last 5 years there it has became easier for marketers to plan out strategies while being cost effective and fruitful. As Email marketing has made people Night Millionaires it has been a big time headache for consumers and end users receiving hundreds or even thousands of SPAM mail landing into their Mailbox. These have made life of MSP's (Mail Service Providers), ISP's (Internet Service providers) to be on the toes every second and tighten the security of the services provided. Also their are many legitimate mails which land up in Users SPAMBOX which is due to some users in the network sending unsolicited commercial email and the IP getting listed in the SPAM Sources.

To select and judge the best in business Email marketing companies you should always check the following points:

1. Server Locations
2. Deliverable of mail
3. Handling Queues
4. Reports
5. Support (Prefer Local Support)
6. Track Record of Company (Google it out for Review You will get the Best)

Advantages
E-mail marketing (on the Internet) is popular with companies for several reasons:

  • An exact return on investment can be tracked ("track to basket") and has proven to be high when done properly. E-mail marketing is often reported as second only to search marketing as the most effective online marketing tactic.

  • Advertisers can reach substantial numbers of e-mail subscribers who have opted in (i.e., consented) to receive e-mail communications on subjects of interest to them.

  • Over half of Internet users check or send e-mail on a typical day.


Disadvantages

  • A report issued by the e-mail services company Return Path, as of mid-2008 e-mail deliverability is still an issue for legitimate marketers. According to the report, legitimate e-mail servers averaged a delivery rate of 56%; twenty percent of the messages were rejected, and eight percent were filtered.

  • Companies considering the use of an e-mail marketing program must make sure that their program does not violate spam laws such as the United States' Controlling the Assault of Non-Solicited Pornography and Marketing Act (CAN-SPAM),the European Privacy and Electronic Communications Regulations 2003, or their Internet service provider's acceptable use policy.

  • As of there are less Strict Spam Laws in India


Companies That has being into the business for long and gained lot of trust in the Email Marketing Industries in India
1. Quantumlink Communications Pvt. Ltd.
They have a state of art Service Name MAILDIRECT managed by Highly skilled team of System Administrators backed up with Professional Support and highly motivated Sales team which cares for your ROI.

MailDirect is hosted on high-end servers, which ensures high-speed Internet connectivity, resulting in extremely low delivery times and zero choke of your bandwidth. Companies can only upload your message and the list, all the rest is done through a very intuitive browser-based interface on the server and your Email / SMS communication campaign is ready to roll.

You can Download Brochure Here

Visit the Company Website at www.qlc.in

2. EMAIL Marketing in India
Best in its class for Bulk Mailing
Visit http://www.emailmarketingindia.com

Friday, April 9, 2010

Howto Install RED5 Flash Media Server in Fedora 11, Centos 5.4, Redhat

Red5 is an Open Source Flash Media Server written in Java that supports:

* Streaming Audio/Video (FLV and MP3)
* Recording Client Streams (FLV only)
* Shared Objects
* Live Stream Publishing
* Remoting (AMF)

This is a reverse engineered open source project which aims to produce a feature-complete implementation written in Java. It os one of the Full implementation RTMP servers other than:

Adobe Flash Media Server,
Onlinelib VCS Video Communication Server
Wowza Media Server
WebORB Integration Server
haXeVideo

In this tutorial we'll learn howto installRED5 on Centos 5.4,Fedora, Redhat and other Linux Distribution, There are many ways to achieve this but this is how i installed RED5 Media Server on Fedora 11.

Red5 Requires Java Development Kit (JDK) to run so you have to install Java onto the system,You can acheive this in 2 ways
1. Either Use Yellow DOG Updater
# yum -y install java-1.6.0-openjdk java-1.6.0-openjdk-devel


OR

Download JDK and Compile
cd /usr/java 
IF /usr/java cannot be found
mkdir /usr/java
Go to the Link and Download http://java.sun.com/javase/downloads/widget/jdk6.jsp and Download jdk-6u19-linux-i586.bin

mv /home/ashwin/Download/jdk-6u19-linux-i586.bin /usr/java/

chmod +x jdk-6u19-linux-i586.bin
./jdk-6u19-linux-i586.bin

You will see
JAVA_HOME="/usr/java/jdk1.6"
export JAVA_HOME
echo $JAVA_HOME


Great Now you have installed JAVA now proceed

Another Important requirement is ANT (It is a Apache Project) which we require to compile the RED5 Code, Good News is you dont need to compile ANT as it is already in binary format Just extract and install it in /usr/java


#cd /home/ashwin/
#w.get http://mirrors.kahuki.com/apache/ant/binaries/apache-ant-1.8.0-bin.tar.bz2
#tar -jxf apache-ant-1.8.0-bin.tar.bz2
#mv apache-ant-1.8.0 /usr/local/ant


Now we need to Export the JAVA and ANT Environment Variables which would help us in installing and proper running if RED5 Server


export ANT_HOME=/usr/local/ant
export JAVA_HOME=/usr/lib/jvm/java
export PATH=$PATH:/usr/local/ant/bin
export CLASSPATH=.:$JAVA_HOME/lib/classes.zip


vi /etc/bashrc

# ALSO Put the Above Here
export ANT_HOME=/usr/local/ant
export JAVA_HOME=/usr/lib/jvm/java
export PATH=$PATH:/usr/local/ant/bin
export CLASSPATH=.:$JAVA_HOME/lib/classes.zip



Now download the latest RED5 CODE from the site to build


cd /home/ashwin/
svn checkout http://red5.googlecode.com/svn/java/server/trunk/ red5
mv red5 /usr/local/
cd /usr/local/red5
ant prepare
ant dist


You would you screen scrolling and you are not able to understand anything "CHILL" All is well and RED5 Media Server is getting compiled, AT the END you would SEE

BUILD SUCCESSFUL

If you see this you have made it you have done 95% of the work. Now copy the conf directory from dist/ and test the red5 installation.

cp -r dist/conf .
./red5.sh


STARTING, STOPPING,RESTARTING RED5 Media Server
I have created a Init Script Click Here

INIT Script to Start,STOP, RESTART RED5 Media Server

Start RED5

/etc/init.d/red5 start


TESTING RED5

Go TO your Browser Address Bar and Type

http://your.ip.address:5080

Check Out the Demos
http://your.ip.address:5080/demos/


ISSUE

When you run ./red5.sh, it will show you Installer service created. Thats mean everything runs fine and red5 server is up. But if you went to port_tester.swf using demos above or your application shows connections FAILS, this is an issue of RTMPT and RTMPTS. You can see it by running


/usr/local/red5/red5.sh

output trancated

[INFO] [main] org.red5.server.tomcat.TomcatLoader – RTMPT server bean was not found
[INFO] [main] org.red5.server.tomcat.TomcatLoader – RTMPS server bean was not found

output truncated

If you see this you have to uncomment the RTMPT and RTMPTS TomcatLoader in/usr/local/red5/conf/red5-core.xml



vi /usr/local/red5/conf/red5-core.xml

Search for a lines



Remove the from end of


Same goes for RTMPS



Remove the from end of




Restart the red5 services and connection fails problem will be fixed.

Init Script to Start, Stop, Restart RED5 Media Server

Click Here Howto Install RED5 Flash Media Server in Fedora 11, Centos 5.4, Redhat

RED5 is Open Source Media Flash Server, Highly Scalable and Customizable

Just Copy the Code in

vi /etc/init.d/red5


COPY the Below Code

#!/bin/sh
# Author : Ashwin
# Description: Red5 Media Flash streaming server

PROG=red5
RED5_HOME=/usr/local/red5
DAEMON=$RED5_HOME/$PROG.sh
PIDFILE=/var/run/$PROG.pid

# Source function library
. /etc/rc.d/init.d/functions

[ -r /etc/sysconfig/red5 ] && . /etc/sysconfig/red5

RETVAL=0

case “$1″ in
start)
echo -n $”Starting $PROG: ”
cd $RED5_HOME
$DAEMON >/dev/null 2>/dev/null &
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo $! > $PIDFILE
touch /var/lock/subsys/$PROG

fi
[ $RETVAL -eq 0 ] && success $”$PROG startup” || failure $”$PROG startup”
echo
;;
stop)
echo -n $”Shutting down $PROG: ”
killproc -p $PIDFILE
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$PROG
;;
restart)
$0 stop
$0 start
;;
status)
status $PROG -p $PIDFILE
RETVAL=$?
;;
*)
echo $”Usage: $0 {start|stop|restart|status}”
RETVAL=1
esac

exit $RETVAL



chmod 755 /etc/init.d/red5

Test It

/etc/init.d/red5 start
/etc/init.d/red5 stop
/etc/init.d/red5 restart

Tuesday, April 6, 2010

Howto setup local yum repository on RedHat Fedora12 Centos5.4

This article is about Setting up a Local yum repository to be used for local network. Local Yum Repository can save internet bandwidth downloading all your packages from the local repository over FAST LAN Network.

If You want to use it in your network the best option to be used is using Httpd - Apache so the yum repository will be acessible via web.

Step 1
Check if Httpd is installed and running

[root@localhost ~]# ps ax | grep http

3617 ? Ss 0:00 /usr/sbin/httpd
3621 ? S 0:00 /usr/sbin/httpd
3622 ? S 0:00 /usr/sbin/httpd
3623 ? S 0:00 /usr/sbin/httpd
3624 ? S 0:00 /usr/sbin/httpd
3625 ? S 0:00 /usr/sbin/httpd
3626 ? S 0:00 /usr/sbin/httpd
3627 ? S 0:00 /usr/sbin/httpd
3628 ? S 0:00 /usr/sbin/httpd
3629 ? S 0:00 /usr/sbin/httpd

If it is not running then Start HTTPD

[root@localhost ~]# /etc/init.d/httpd start

OR

[root@localhost ~]# service httpd start


and if you haven't installed httpd yet then you can do it by

[root@localhost ~]# yum install httpd


Now make httpd start at every system boot automatically by putting it in system Startup.

[root@localhost ~]# chkconfig --levels 235 httpd on

Start apache
[root@localhost ~]# /etc/init.d/httpd start
OR
[root@localhost ~]# service httpd start


How to Build the Repository
We will use Apache's default Document root to store the packages, Default DocumentRoot for apache is "/var/www/html".

Create a dir in the Document Root named yum. We will create two more directories
base-pkg : This would contain all the packages of the Linux Distribution you are making repository for.
updates : This would contain all the update packages for your Linux Distribution

[root@localhost ~]# mkdir /var/www/html/yum
[root@localhost ~]# mkdir /var/www/html/yum/base-pkg
[root@localhost ~]# mkdir /var/www/html/yum/updates


BUILDING YOU REPOSITORY

To build you yum repository the easy way is copy all the contents from the Linux Distribution DVD/CD Media to the repository location in this case /var/www/html/yum, Make sure that you copy all the contents (Packages) into the base-pkg directory. If you have a Media follow the Steps Below


[root@localhost ~]# mount /dev/cdrom /mnt
[root@localhost ~]# cp -v /mnt/Packages/* /var/www/html/yum/base-pkg/
[root@localhost ~]# umount /mnt


Now we need a tool "createrepo" which would create a repository for the linux distibution. By default it is comes installed with all Distribution of linux, but if its not installed use yum to install it.
Check if createrepo is installed
[root@localhost ~]# which createrepo
/usr/bin/createrepo


If you get the above result skip the next step and start Building the repository if its not installed then install it
[root@localhost ~]# yum install createrepo


Now Run the createrepo tool

[root@localhost ~]# createrepo /var/www/html/yum/base-pkg/

[root@localhost ~]# ls -l /var/www/html/yum/base-pkg/repodata/
-rw-r--r-- 1 root root 2227275 2010-02-18 11:51 filelists.xml.gz
-rw-r--r-- 1 root root 6487453 2010-02-18 11:51 other.xml.gz
-rw-r--r-- 1 root root 747714 2010-02-18 11:51 primary.xml.gz
-rw-r--r-- 1 root root 951 2010-02-18 11:51 repomd.xml

The Second step building repository is updating your updates directory for all new packages. Go to the Main website of the Linux Distribution you are preparing repostory for and check the updates link or use the below links

CENTOS : rsync://centos.arcticnetwork.ca/centos/5.4/updates/i386/RPMS/
FEDORA : rsync rsync://mirror.aarnet.edu.au/fedora/linux/updates/12/i386/

As per you distribution rsync the data to the updates directory
FOR CENTOS RUN
[root@localhost ~]# rsync -avrt rsync://centos.arcticnetwork.ca/centos/5.4/updates/i386/RPMS/ --exclude=debug/ /var/www/html/yum/updates/
FOR CENTOS RUN
[root@localhost ~]# rsync -avrt rsync://mirror.aarnet.edu.au/fedora/linux/updates/12/i386/ --exclude=debug/ /var/www/html/yum/updates/


To get the updates regularly you can put the above command inthe crontab so that you updates directories are updated periodically

[root@localhost ~]# crontab -e 
* * 2 * * rsync -avrt rsync://centos.arcticnetwork.ca/centos/5.4/updates/i386/RPMS/ --exclude=debug/ /var/www/html/yum/updates/


You have created local yum repository, now to make clients on your network to use the local repository, create a file mylocal.repo in /etc/yum.repos.d

[root@localhost ~]# vim /etc/yum.repos.d/mylocal.repo
Add the Following Lines

[base-local]
name=Centos $releasever - $basearch
failovermethod=priority
baseurl=http://192.168.1.1/yum/base-pkg/
enabled=1
gpgcheck=0

[updates-local]
name=Centos $releasever - $basearch - Updates
failovermethod=priority
baseurl=http://192.168.1.1/yum/updates/
enabled=1
gpgcheck=0


THAT's IT, Now you can update all your packages over high Speed Lan connectivity instead of Internet.

Thursday, March 25, 2010

Quick Understanding Linux Cron in under 3 Minutes

What is Cron?
In Layman Languages, cron is a Task scheduler used in Linux operating System (but with Great Powers if used with it Complete functionality) developed by Paul Vixie. You can schedule a specific task to be run every minute,hour,day,month.

Majorly cron is used to automate jobs daily without human intervention or manual running of command. Cron can be configured using configuration files which resides in "/etc", changes to which can be done only by the Administrator. Cron also has the feature to run commands using particular user.
Crontab entries


| --------------------------------------------------------------    Minutes (00 - 59)
|    ------------------------------------------------------    Hours (00 - 24)
|    |    ----------------------------------------------    Day of Month (01 - 30)
|    |    |    --------------------------------------    Month (01 - 12)
|    |    |    |    ------------------------------  Day of Week (0 - 6) (Sunday = 0)
|    |    |    |    |    ----------------------    User to the Run the Command
|    |    |    |    |    |        ------    Command / Script to be Executed
|    |    |    |    |    |        |

*    *    *    *    *    root    /home/linuxmaza.com/htdocs/scripts/Stats_Update.sh

If you are a lazy System Adminstrator and Dont want to write the whole entry, cron has several special entries which are shortcuts for specifying a Complete entry.
You can specify entries as below

Entry       ||    Description          ||    Equivalent To
=====================================================
@reboot     Run once, at startup.     None
@yearly     Run once a year     0 0 1 1 *
@annually     (same as @yearly)     0 0 1 1 *
@monthly     Run once a month     0 0 1 * *
@weekly     Run once a week     0 0 * * 0
@daily         Run once a day         0 0 * * *
@midnight     (same as @daily)     0 0 * * *
@hourly     Run once an hour     0 * * * *

Operators in Cron
There are way of specifying multiple date and time in a field which can be overcomed using Operators in cron.

  • The comma (',') operator specifies a list of values, for example: "1,3,4,7,8" (Spaces between the values are not accepted)

  • The dash ('-') operator specifies a range of values, for example: "1-6", which is equivalent to "1,2,3,4,5,6"

  • The asterisk ('*') operator specifies all possible values for a field. For example, an asterisk in the hour time field would be equivalent to 'every hour' (depending on other values entered in other fields).

  • The Forward Slash ('/') operator is used to SKIP a given number of values. "Say the value we used is 5" "For Example, "*/5" in the hour time field is equivalent to "0,5,10,15,20" and so on.


Cron Advantages :
1. Can Handle Multiuser
2. Cron enables users to schedule jobs to run automatically at a certain time or date.
3. Automate daily System Administration tasks
4. Operators in Cron saves time and confusion while creating many crons.
5. Support for Special entries using (@reboot, @yearly, @monthly, @weekly, @hourly, @midnight, @daily).


Some Examples
1. If you want to run a task every Hour

0 * * * * root w > /var/log/mysystemstats.log
OR
@hourly root w > /var/log/mysystemstats.log

Above entry would run the "w" command at the start of every hour and redirect the output to "/var/log/mysystemstats.log"

2. Scheduling a cron job running every 15 minutes to delete apache Logs

15 * * * * echo " " > /var/log/httpd/access_log

3. Run a job every 5 hours
* 0,5,10,15,20 * * * echo " " > /var/log/httpd/access_log

Sunday, March 21, 2010

Script to Check IP on SPAM Sources and getting EMAIL and SMS alerts.

As a System Administrators "The Key to a good performing Server is Good IP Reputation"

Maintaining a MAIL Servers or Web Servers is big time for System Admins,there is always a big fear for your IP getting Blacklisted on different SPAM sources due to which mails originated from your server either are not accepted or deffered by the Recipient Server.It would of great help if we get timely EMAIL as well as SMS alerts of IP getting blacklisted. This would make servers perform well as BOUNCES do use system resources which impact on system overall performance (Explaining Which in this article is OUT OF SCOPE.)

You can get this by Paying a Handsome amount of money to a Service Provider or DO MY way. I have written a Shell script using which you can get timely alerts as your IP gets blacklisted. You can put the script in crontab to run every Hour or so.

To START with Copy the script onto you system

# mkdir dnsbl && cd dnsbl

# vim dnsbl_check.sh


Copy the Below Script

#!/bin/bash

# Date: Mar 20,2010
# Author: Ashwin Muni
# Purpose: Check the IP Against Major SPAM Sources.

## Uncomment to Debug
# set -x

# Variables
tmp_file='/tmp/dnsbl'

#IN_DNSBL=127.0.0.[2-6]
#IN_DNSBL=127.0.0.
IN_DNSBL='127.0.0.2|127.0.0.3|127.0.0.4|127.0.0.5|127.0.0.6|127.0.0.7|127.0.0.8|127.0.0.9|127.0.0.10|127.0.0.'
DIG=`which dig`
MAIL_ADMIN="test@example.com ashwin@linuxmaza.com"

###################################################

# SCRIPT START

> $tmp_file

echo "Below IPs are Listed" >> $tmp_file

if [ "$#" == 1 ]; then

for i in `cat rbllist.txt`; do
IP_REV=`echo $1 | awk -F\. '{ print $4"."$3"."$2"."$1 }'`
$DIG $IP_REV.$i | grep $IN_DNSBL

if [ $? == '0' ]; then
#echo "$1 Listed on $i"
echo -e "\033[31m \033[1m PROBLEM : Listed on $i \033[0m \033[22m"
echo "################################ Attention : $1 Listed on $i" >> $tmp_file
else
echo -e "Not Listed on $i : \033[32m \033[1m OK \033[22m \033[0m "
echo "$1 Not Listed on $i" >> $tmp_file
fi
done

echo -e "\033[31m \033[1m ===================$1 is LISTED ON BELOW SPAM SOURCES====================== \033[0m \033[22m"

cat $tmp_file | mail -s "DNSBL REPORT FOR $1" $MAIL_ADMIN

else

echo -e "\t\t\t\t\033[31m \033[1m Enter Proper Arguments:\n Script Usage :\n /bin/sh $0 IP.ADD.RE.SS \033[0m \033[22m"

# EOF

################################################


Save the file Using ":wq"

Make necessary changes in the Script like the System Admin email address to sent Emails.

You will need the SPAM sources to check which you can find Here MAJOR SPAM SOURCES

Copy all the SPAM Sources and paste it in a txt file named "rbllist.txt"

# vi rbllist.txt


Should show you all the Major SPAM Sources for Checking your IPs.

Note: The script and the rbllist.txt should exist in the Same directory.

Once done we will give executable permission to the script which allows us to run it.

# chmod 755 dnsbl_check.sh


OR

# chmod +x dnsbl_check.sh


Now Run the Script

#./dnsbl_check.sh 100.200.100.200


You can put the script in crontab to run it regularly.

MAJOR SPAM Sources where your IPs can get blacklisted which could affect your service.

MAJOR SPAM Sources where your IPs can get blacklisted which could affect your service. Most of the Players in the market like Yahoo, Google, Hotmail use this for stopping huge SPAM to their servers. Many appliances do the same to STOP SPAM.

SPAM Sources

3y.spam.mrs.kithrup.com
access.redhawk.org
all.rbl.kropka.net
all.spamblock.unit.liu.se
assholes.madscience.nl
blackholes.five-ten-sg.com
blackholes.intersil.net
blackholes.mail-abuse.org
blackholes.sandes.dk
blackholes.uceb.org
blackholes.wirehub.net
blacklist.sci.kun.nl
blacklist.spambag.org
bl.borderworlds.dk
bl.csma.biz
block.dnsbl.sorbs.net
blocked.hilli.dk
blocklist2.squawk.com
blocklist.squawk.com
bl.redhatgate.com
bl.spamcannibal.org
bl.spamcop.net
bl.starloop.com
bl.technovision.dk
cart00ney.surriel.com
cbl.abuseat.org
dev.null.dk
dews.qmail.org
dialup.blacklist.jippg.org
dialup.rbl.kropka.net
dialups.mail-abuse.org
dialups.visi.com
dnsbl-1.uceprotect.net
dnsbl-2.uceprotect.net
dnsbl-3.uceprotect.net
dnsbl.ahbl.org
dnsbl.antispam.or.id
dnsbl.cyberlogic.net
dnsbl.kempt.net
dnsbl.njabl.org
dnsbl.solid.net
dnsbl.sorbs.net
dsbl.dnsbl.net.au
duinv.aupads.org
dul.dnsbl.sorbs.net
dul.ru
dun.dnsrbl.net
dynablock.njabl.org
dynablock.wirehub.net
fl.chickenboner.biz
forbidden.icm.edu.pl
form.rbl.kropka.net
hil.habeas.com
http.dnsbl.sorbs.net
http.opm.blitzed.org
intruders.docs.uu.se
ip.rbl.kropka.net
korea.services.net
l1.spews.dnsbl.sorbs.net
l2.spews.dnsbl.sorbs.net
lame-av.rbl.kropka.net
list.dsbl.org
mail-abuse.blacklist.jippg.org
map.spam-rbl.com
misc.dnsbl.sorbs.net
msgid.bl.gweep.ca
multihop.dsbl.org
no-more-funn.moensted.dk
ohps.bl.reynolds.net.au
ohps.dnsbl.net.au
omrs.bl.reynolds.net.au
omrs.dnsbl.net.au
opm.blitzed.org
op.rbl.kropka.net
orbs.dorkslayers.com
orid.dnsbl.net.au
or.rbl.kropka.net
orvedb.aupads.org
osps.bl.reynolds.net.au
osps.dnsbl.net.au
osrs.bl.reynolds.net.au
osps.dnsbl.net.au
osrs.bl.reynolds.net.au
osrs.dnsbl.net.au
owfs.bl.reynolds.net.au
owfs.dnsbl.net.au
owps.bl.reynolds.net.au
owps.dnsbl.net.au
pdl.dnsbl.net.au
probes.dnsbl.net.au
proxy.bl.gweep.ca
psbl.surriel.com
pss.spambusters.org.ar
rbl.cluecentral.net
rblmap.tu-berlin.de
rbl.rangers.eu.org
rbl.schulte.org
rbl.snark.net
rbl.triumf.ca
rdts.bl.reynolds.net.au
rdts.dnsbl.net.au
relays.bl.gweep.ca
relays.bl.kundenserver.de
relays.dorkslayers.com
relays.mail-abuse.org
relays.nether.net
relays.visi.com
ricn.bl.reynolds.net.au
ricn.dnsbl.net.au
rmst.bl.reynolds.net.au
rmst.dnsbl.net.au
rsbl.aupads.org
satos.rbl.cluecentral.net
sbl.csma.biz
sbl.spamhaus.org
sbl-xbl.spamhaus.org
smtp.dnsbl.sorbs.net
socks.dnsbl.sorbs.net
socks.opm.blitzed.org
sorbs.dnsbl.net.au
spam.dnsbl.sorbs.net
spam.dnsrbl.net
spamguard.leadmon.net
spam.olsentech.net
spamsites.dnsbl.net.au
spamsources.dnsbl.info
spamsources.fabel.dk
spamsources.yamta.org
spam.wytnij.to
spews.dnsbl.net.au
t1.bl.reynolds.net.au
t1.dnsbl.net.au
ucepn.dnsbl.net.au
unconfirmed.dsbl.org
vbl.messagelabs.com
vox.schpider.com
web.dnsbl.sorbs.net
whois.rfc-ignorant.org
will-spam-for-food.eu.org
wingate.opm.blitzed.org
xbl.spamhaus.org
zombie.dnsbl.sorbs.net
ztl.dorkslayers.com

Check you IP if is blacklisted using a script SPAM-IP Reputation Check Script

Sunday, March 7, 2010

Top Linux Admin Interview Questions and answers asked in TOP IT industries : Question Bank 06

Linux Admin Interview Questions and Answers


Questions consists of Linux Admin Interview Questions and Answers, Linux Administration questions, Linux Networking questions, MYSQL questions, bash, postfix questions, sendmail questions, ftp server questions

Questions BANK 06


# What command can you use to review boot messages?

# What file defines the levels of messages written to system log files?

# What account is created when you install Linux?

# While logged on as a regular user, your boss calls up and wants you to create a new user account immediately. How can you do this without first having to close your work, log off and logon as root? Choose one:
a. Issue the command rootlog.
b. Issue the command su and type exit when finished.
c. Issue the command su and type logoff when finished.
d. Issue the command logon root and type exit when finished.

# Which file defines all users on your system? Choose one:
a. /etc/passwd
b. /etc/users
c. /etc/password
d. /etc/user.conf

# There are seven fields in the /etc/passwd file. Which of the following lists all the fields in the correct order? Choose one:
a. username, UID, GID, home directory, command, comment
b. username, UID, GID, comment, home directory, command
c. UID, username, GID, home directory, comment, command
d. username, UID, group name, GID, home directory, comment

# Which of the following user names is invalid? Choose one:
a. Theresa Hadden
b. thadden
c. TheresaH
d. T.H.

# In order to prevent a user from logging in, you can add a(n) ________at the beginning of the password field.

# The beginning user identifier is defined in the _________ file.

# Which field is used to define the user’s default shell?

# Bob Armstrong, who has a username of boba, calls to tell you he forgot his password. What command should you use to reset his command?

# Your company has implemented a policy that users’ passwords must be reset every ninety days. Since you have over 100 users you created a file with each username and the new password. How are you going to change the old passwords to the new ones? Choose one:
a. Use the chpasswd command along with the name of the file containing the new passwords.
b. Use the passwd command with the -f option and the name of the file containing the new passwords.
c. Open the /etc/passwd file in a text editor and manually change each password.
d. Use the passwd command with the -u option.