Disabling direct root login

Inorder to disable direct root login on a linux server, you need to do the following thing:

1. vi /etc/ssh/sshd_config in that file make
Permitrootlogin no then save it

2. Restart sshd service
/etc/init.d/sshd restart

3. Now create a new user and set password for that user.

4. Add that user to the wheel group
vi /etc/groups // add that user to the group of wheel

5. Now logon to the server using the username and password and then do
su - and provide the root password



Inorder to work this properly you should have the following permission settings

chmod 4755 /bin/su
chmod 1700 /etc/passwd
chmod 1700 /etc/shadow
chmod 1755 /etc/groups


If there is anything wrong with this permission, you may get permission denied or incorrect password errors.
Wink


E
njoy:)

RSYNC

rsync utility is used for synchronising files one of the major adavantage of rsync is that rsync can preserve permissions and ownership information, copy symbolic links, and generally is designed to intelligently handle your files

The basic syntax for rsync is simple enough -- just run
rsync [options] source destination

If you want to rsync the contents from /home/mabin/ to /var/www/html/ the command

rsync -a /home/mabin /var/www/html

Whe doing rsync there is a big meaning in the ending '/' because if I rsync /home/mabin/ then only the contents inside the folder mabin will be copied.....but if didn't used the '/' ie /home/mabin then the entire directory will be taken ..that is a directory named mabin will be created at the destination

some switches with rsync
-----------------------------
-a --> archive option, which actually combines several rsync options. It combines the recursive and copy symlinks options, preserves group and owner, and generally makes rsync suitable for making archive copies. Note that it doesn't preserve hardlinks

-H --> Copies hard link

-v --> verbose mode

-z --> Compress option, will compress the data during transfer

--delete --> For deleting the already transferred data from source (a dangerous option, try to avoid it)

--exclude=".*/" --> To avoid copying hidden files. With this option you can avoid copying any particular file( If you dont want to copy .php files then pot it like this --exclude="*.php/"

sample command for local copying
----------------------------------------

rsync -avh /home/mabin/ /var/www/html


Rsync for remote copying
------------------------------------------------------------

rsync -avhe ssh /home/user/dir/ user@remote.host.com:dir/


If you want to know how fast the transfer is going use the --progress option

rsync --progress -avhe ssh /home/user/dir/ user@remote.host.com:dir/

Enjoy:)

Roundcube installation on cPanel server

1-Login to the server as root and run the following:

cd /usr/local/cpanel/base
wget http://dfn.dl.sourceforge.net/sourceforge/roundcubemail/roundcubemail-0.1.1.tar.gz
tar -zxvf roundcubemail-0.1.1.tar.gz
rm -rf roundcubemail-0.1.1.tar.gz
mv -f roundcubemail-0.1.1 roundcube
chown root.root -R roundcube
cd roundcube
chmod -R 777 temp
chmod -R 777 logs
mysql -e “CREATE DATABASE roundcube;” -pDATABASEPASSWORD
mysql -e “use roundcube; source SQL/mysql.initial.sql;” -pDATABASEPASSWORD
cd config
mv db.inc.php.dist db.inc.php
mv main.inc.php.dist main.inc.php

Note:Replace DATABASEPASSWORD with your server MySQL root password

2-Open db.inc.php with Pico

pico db.inc.php

Find this line in the file using (Ctrl+w)

$rcmail_config['db_dsnw'] = ‘mysql://roundcube:pass@localhost/roundcubemail’;

Replace the line above with the following line:

$rcmail_config['db_dsnw'] = ‘mysql://root:DATABASEPASSWORD@localhost/roundcube’;

Note:Replace DATABASEPASSWORD with MySQL server root password

save and close.

3-Open main.inc.php with pico

pico main.inc.php

find the following lines in the file and edit their values as the following:

$rcmail_config['enable_caching'] = FALSE;
$rcmail_config['default_host'] = ‘localhost’;
$rcmail_config['enable_spellcheck'] = FALSE;
Save and close

4-There are some changes need to be done in index.php file, instead of telling you what to find, add or remove, I have made a ready to made index.php file for you to use and you are done.

You can get the index.php file by running the following command lines:

cd /usr/local/cpanel/base/roundcube
wget http://www.2mhostblog.com/rc.1.1.tar
rm -f index.php
tar -xf rc.1.1.tar
rm -f rc.1.1.tar

5-Finally, restart your cpanel service

service cpanel restart

Enjoy:)

Installing Subversion Using yum on CentOS 5

Is is very simple, you can install it by using yum. But I found most of the time it is not as simple as we assume.

While attempting to install Subversion via yum today, I received the following error:

[root@sXXX ~]# yum install subversion
Loading “installonlyn” plugin
Setting up Install Process
Setting up repositories
extras 100% |=========================| 1.1 kB 00:00
updates 100% |=========================| 951 B 00:00
bla..bla..:)
bla..:)
bla..:)
Error: Missing Dependency: perl(URI) >= 1.17 is needed by package subversion

Steps to resolve this:

#wget http://yum.trixbox.org/centos/5/RPMS/perl-URI-1.35-3.noarch.rpm
#rpm -i perl-URI-1.35-3.noarch.rpm
#yum install subversion

That's it.

Enjoy:)