SSH Server Hardening in one of the security part to secure your server.Refer following steps to secure SSH. root@serevr[~]#pico /etc/ssh/sshd_config Uncomment #Protocol 2, 1 Change to Protocol 2 Append these lines to the bottom: LoginGraceTime 120 IgnoreRhosts yes X11Forwarding no Save file and restart the SSH service. root@serevr[~]#/etc/rc.d/init.d/sshd restart Note : SSH Protocol one based servers […]
Archive for December, 2011
How to define iptables rules save option?
iptables creating rules after restarting the iptables. When iptables service is restarted settings from /etc/sysconfig/iptables file are applied and used with the iptables. You can either set up iptables rule so that current stat is saved the rule upon restart or stop/start: You need to make changes in following file as per your requirement for […]
How to disable root login and enable key authentication on Dedicated server?
How to disable root login and enable key authentication on Dedicated server? Refer following steps to disable direct root login. 1. SSH into your server as root user. 2. Open file sshd_config in your favorite editor pico /etc/ssh/sshd_config 3. Find the line Protocol 2, 1 4. Uncomment line and change it to look like Protocol […]
Script to check the ip for domains
Many time we are facing the problem while auditing the server for active domains, at that time we can use the following script to check which domain is resolving to which ip. Copy all the domains hosted on the server in the simple text file, for example we have copied all the domains in the […]
MySql server error “Client does not support authentication protocol”.
After upgrade server to 5.1 generally we are getting following error message. Client does not support authentication protocol requested by server; consider upgrading MySQL client. The above error message are receiving because latest version of MySql uses a new format for the password in that case to use older client to use older version Mysql […]
Simple php script to check database connection
To check the database connection script you can use following code under your domain <?php mysql_connect(“localhost”, “admin”, “1admin”) or die(mysql_error()); echo “Connected to MySQL<br />”; mysql_select_db(“test”) or die(mysql_error()); echo “Connected to Database”; ?> After browsing the database connection script you will see following content if database connect to your server. Connected to MySQL Connected to […]
How to repair mysql database table manually?
You can repair the database table manually from shell by using following command. root@admin[~]mysql>mysql –u databaseusername –p databasename For example if we are using database gunjan_db root@admin[~]mysql mysql> use gunjan_db; Database changed mysql> show tables; +———————————————+ | Tables_in_gunjan_db | +———————————————+ | additional_images | address_book | address_format | administrators | banners | banners_history | cache […]
phpmyadmin error “Cannot start session without errors”
“cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.” To resolve above error you need to change the values in/usr/local/cpanel/3rdparty/etc/phpmyadmin/php.ini file. root@admin[~]#pico /usr/local/cpanel/3rdparty/etc/phpmyadmin/php.ini And than change the following values in php.ini file FROM: —– session.save_handler = sqlite session.save_path =/var/cpanel/userhomes/cpanelphpmyadmin/sessions/phpsess.sdb —– TO —– […]
How to check mysql servers set values?
Most of the time we need to check the mysql value set on server and most of the techs checks /etc/my.cnf file.If you want to check all values set in mysql on server. We can use following simple command. mysqld –no-defaults –verbose –help
Database sizes shows zero in cPanel
Once we upgrade from cPanel 11.24 to 11.25 version. We are receiving lots bug. One of them is database size showing zero in cPanel. To resolve this issue you have to edit following file /var/cpanel/cpanel.config root@support[~]vi /var/cpanel/cpanel.config Search line “disk_usage_include_sqldbs” in file “ /var/cpanel/cpanel.config “and change it From disk_usage_include_sqldbs=0 to disk_usage_include_sqldbs=1 And run script -/scripts/update_db_cache








