Friday, April 19, 2013

SSH Login without Password

You can login to a remote Linux server without entering password.

Run ssh-keygen commands to creates the public and private keys on the client machine

[bhagwat@it .ssh]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/bhagwat/.ssh/id_rsa): PRESS ENTER
Enter passphrase (empty for no passphrase): PRESS ENTER
Enter same passphrase again: PRESS ENTER
Your identification has been saved in /home/bhagwat/.ssh/id_rsa.
Your public key has been saved in /home/bhagwat/.ssh/id_rsa.pub.
The key fingerprint is:
5a:ac:52:83:fc:03:d9:d9:d3:cb:d7:41:66:c5:1c:d8 bhagwat@it
The key's randomart image is:


[bhagwat@it .ssh]$ 




Now you have ssh keys stored at .ssh folder of user
Just copy the key inside the id_rsa.pub file 

Go to Server & open ~/.ssh/authorized_keys file
Paste the copied key from client & It's done 

If you are still trouble in login Just change the permission on authorized_keys file of server to below :
chmod 640 authorized_keys


* To allow root access with SSH Keys only please change the below setting  in/etc/ssh/sshd_config
PermitRootLogin without-password


* To Disable root access for all users 

PermitRootLogin no



 

Tuesday, April 16, 2013

How to Install phpmyadmin in Centos - Manually

I always prefer to install it manually

First install apache, php & php-mysql

yum install  httpd php php-mysql

Download phpMyAdmin & extract it at /var/www/html location

cd /var/www/html
wget http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/3.5.8/phpMyAdmin-3.5.8-all-languages.zip

unzip  phpMyAdmin-3.5.8-all-languages.zip

Now RENAME the folder 

mv phpMyAdmin-3.5.8-all-languages/ phpmyadmin

Change Permission
chmod -R 755 phpmyadmin


Rename the Config File
cd phpmyadmin

mv config.sample.inc.php config.inc.php

Restart Apache
/etc/init.d/httpd restart

Open your browser & type

http://<Your IP address>/phpmyadmin/index.php



It's Done