Monday 10 September 2012

SKM (Secure Key Management)

SSH-Key Management Server (Linux Secure Server)\
Preparing the server :
In order for skm to work properly, you need to setup a LAMP (Linux Apache MySQL PHP ) server.
1.     yum install mysql mysql-server
2.     chkconfig --levels 235 mysqld on
3.     /etc/init.d/mysqld start
4.     mysql_secure_installation      
5.     yum install httpd
6.     chkconfig --levels 235 httpd on
7.     /etc/init.d/httpd start
8.     yum install php
9.     /etc/init.d/httpd restart
10.            vi /var/www/html/info.php                               //  <?php phpinfo () ; ? >
11.            yum install php-mysql php-gd php-imap php-ldap php-mbstring php-odbc php-pear php-xml php-xmlrpc
12.            /etc/init.d/httpd restart

14.            yum install phpmyadmin

15.            vi /etc/httpd/conf.d/phpmyadmin.conf
#<Directory "/usr/share/phpmyadmin">
#  Order Deny,Allow
#  Deny from all
#  Allow from 127.0.0.1
#</Directory>
 
16.                  vi /usr/share/phpmyadmin/config.inc.php
$cfg['Servers'][$i]['auth_type'] = 'http';             //chang cookie with http
 
17.                  /etc/init.d/httpd restart
 
 
 
18.            Create a directory named 'skm' where you want the site to be. Let's say in /var/www/html/skm.
Create a file called skm.conf or entry in httpd.conffile with the following lines: 
 
Alias /skm/ "/var/www/html/skm/"
<Directory "/var/www/html/skm/">
PassengerEnabled off
AuthType Basic
AuthName "Restricted Files"
AuthUserFile /etc/httpd/htpasswd.skm
Require user amir
    Options None
    AllowOverride all
    Order allow,deny
    Allow from all
</Directory>
 
19.                  Download the latest skm package and archive in /var/www/html directory
   
20.                  Create a database skm with full privileges skmadmin user 
 
To create the database, run the following command in skm directory.
 
21.                   mysql -u root -pamir skm < skm_creation.sql
 
22.                  Edit the file config.inc.php and change skmadmin password with the new password.
 
23.                  Go through phpmyadmin select your database, then the 'security' table. Then click the 'insert' tab to create a new record : Select MD5 for the function and type in your password.

24.                  On skm machine, used Apache as user. The homedir is /var/www/.ssh/id_rsa.pub to the root /root/.ssh/authorized_keys file of the 'client' server.

Go to http://SSK-SERVER/skm/index.php
25.                   Create SSH Keys get from user machine, Add in Account & Host which user want to access without password.
26.                  Troubleshooting: with sshd_config(server side)
 
 

No comments:

Post a Comment