Changing FTP password of all accounts in a cPanel server.

0

Changing FTP password of all accounts in a cPanel server.

Here is a cPanel script [chpass] to reset each user’s password. Its syntax is as follows

/scripts/chpass

After running the script always run the following script

/scripts/ftpupdate

Using the above cPanel script I have created my own script to change all users password in one shot.

Script:

—————————
#/bin/bash
cat /etc/trueuserdomains | sort -t” ” -k2 > LIST.txt
exec 7 LIST.txt
for i in `cat /etc/trueuserdomains | awk ‘{ print $2 }’ | sort`; do
read > pass
sleep 1
done
/scripts/ftpupdate

—————————

What actually this script is doing?

01. Makes a sorted list of ‘/etc/trueuserdomains’ [sort with usernames] in a file ‘LIST.txt’
02. A File Descriptor opened for ‘LIST.txt’
03. Opened a for loop to itarate each users in ‘/etc/trueuserdomains’
04. Read the first line in the FD and remove the same on each iteration
05. Store a date format in a variable for generating password
06. Store a part of user name, say from third character of the name to last character, in variable for complicating the generated password
07. Executing the cPanel password changing script with appropriate parameters
08. Outing the information [Domain Name, User Name and New Password] to a file named “pass” on each iteration
09. Making a delay of 1 second on each iteration
10. Ending the for loop
11. Running cPanel password synchronization script.
==============================

How to Limit FTP connections (pure-FTP)

0

How to Limit FTP connections from the same IP address? (pure-FTP)

# Maximum number of sim clients with the same IP address

MaxClientsPerIP 8

1. Open the pure-FTP configuration file.

vim /etc/pure-ftpd.conf

2. Search for the line “MaxClientsPerIP” and change the value to a required one. By default the value is 8. It is not recommended to increase the value for security reasons.

3. Restart FTP service using the command given below.

/etc/init.d/pure-ftpd restart

—————————————->

Unable to login to FTP account + Windows Plesk

9

Unable to login to FTP

#ftp linuxtechme.wordpress.com
Connected to linuxtechme.wordpress.com.
220 Microsoft FTP Service
User (linuxtechme.wordpress.com:(none)): admin
331 Password required for admin.
Password:
530-User cannot log in, home directory inaccessible.
Win32 error: Access is denied.
Error details: Authorization rules denied the access.
530 End
Login failed.
ftp> quit
221 Goodbye.

Make sure that IP of domain hasn’t pointing to wrong directory in IIS. Correct it if necessary and reconfigure ftp with

cd %Plesk_bin%

\Plesk\admin\bin>ftpmng.exe –remove-all
\Plesk\admin\bin>ftpmng.exe –reconfigure-all

——————————>

How to troubleshoot spamming activities on postfix mail server.

1

How to troubleshoot spamming activities on postfix mail server.

1. To see the mail queue:

# mailq

2. To flush the mail queue:

# postfix flush OR

# postfix -f

3. To remove all mails from the queue:

# postsuper -d ALL

4. To remove all mails in the deferred queue:

# postsuper -d ALL deferred

5. To delete all queued messages from or to the domain called spamdomain.com:

# ./postfix-delete.pl spamdomain.com

6. To delete all queued messages that contain the word “abc” in the e-mail address:

# ./postfix-delete.pl abc

7. To know the number of messages sitting in the deferred queue:

# find /var/spool/postfix/deferred -type f | wc -l

8. To get a sorted list of the accounts that have the most mail in the queue. This usually means a maximum of 2 or 3 spammers at the end of the list:

# mailq|grep ^[A-F0-9]|cut -c 42-80|sort |uniq -c|sort -n|tail
——————————————->

Unable to install mcrypt on Plesk 9 php5.3

0

Unable to install mcrypt on Plesk 9 php.5.3

#yum install php53-mcrypt

php53-common-5.3.3-13.el5_8.x86_64 from base has depsolving problems
–> php53-common conflicts with php-common
Error: php53-common conflicts with php-common
You could try using –skip-broken to work around the problem
You could try running: package-cleanup –problems
package-cleanup –dupes
rpm -Va –nofiles –nodigest
The program package-cleanup is found in the yum-utils package.

Why this happens because the package is not available in the Plesk repo. So I have added epel repo on the server.

#wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
#rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

#yum install php53-mcrypt

# php -v
PHP 5.3.3 (cli) (built: Jun 27 2012 12:25:48)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with the ionCube PHP Loader v4.0.7, Copyright (c) 2002-2011, by ionCube Ltd.
———————————————
[root@~]# php -m | grep mcrypt
mcrypt
———————————->