Monday, May 17, 2010

Please configure it so that the server will send an email to ‘patrick@mobile9.com’ whenever someone logs into the server as root.

We can do it this in two ways

======
SSH:

echo 'SSH Root Access (Your Server Name) on:' `date` `who` | mail -s "ALERT: Root Access from `who | cut -d"(" -f2 | cut -d")" -f1`" your@email-address.com

OR

WHM:

For tweaking this from WHM, the exact steps are:

Login to WHM > Scroll down the left menu to the bottom to reach the Plugins section > ConfigServer Security & Firewall > Firewall Configuration:

LF_SSH_EMAIL_ALERT: Send an email alert if anyone uses su to access another account. This will send an email alert whether the attempt to use su was successful or not.

LF_SU_EMAIL_ALERT: Send an email alert if anyone accesses WHM via root. An IP address will be reported again 1 hour after the last tracked access (or if lfd is restarted).

To find a string in the server

grep "reelgrrlsseattle" */*/*

grep -iRl reelgrrlsseattle ./*

csf installation error

[root@server22 csf]# sh install.sh

Configuring for OS

Checking for perl modulesfailed
You need to install the LWP perl module (libwww-perl) and then install csf
[root@server22 csf]#

To fix the error, install libwww-perl

yum install perl-libwww-perl

Roundcube hangs when sending mail

Roundcube hangs when sending mail

In recent builds of roundcube, you may find that you can’t send mail using Roundcube. If /var/cpanel/roundcube/log/errors shows the following:

[30-Jan-2009 14:07:11] Invalid response code received from server (421):
[30-Jan-2009 14:07:11] Invalid response code received from server (-1):
[30-Jan-2009 14:07:34 -0800] SMTP Error: SMTP error: Authentication failure: STARTTLS failed (Code: ) in /usr/local/cpanel/base/3rdparty/roundcube/program/steps/mail/func.inc on line 1248 (POST /3rdparty/roundcube/index.php?_task=mail&_action=send)
[30-Jan-2009 14:10:29] STARTTLS failed ():

Then there is an issue with the most recent Net-SMTP PHP module. To resolve this, edit the following file:

vi /usr/local/cpanel/base/3rdparty/roundcube/config/main.inc.php

and change

// SMTP username (if required) if you use %u as the username RoundCube
// will use the current username for login
$rcmail_config['smtp_user'] = ‘%u’;

to this:

// SMTP username (if required) if you use %u as the username RoundCube
// will use the current username for login
$rcmail_config['smtp_user'] = ”;

cant send attachement

Requested action aborted: error in processing
451 Error while writing spool file

===========

check df -h
and also check user quota

if /var is full the n we cant send attachements

loacl IP poblem

Bringing up interface eth0: Error, some other host already uses address 192.168.1.11.

===========
vi /etc/sysconfig/network-scripts/ifcfg-eth0
change the IP

IPADDR=
==========

/etc/init.d/network restart

vps load average

vzlist -o veid,laverage|sort -nrk 2|head -5