Wednesday, 21 August 2013

Tomcat 7 SSL configuration

Hello,

I am going to explain how the ssl is configured in tomcat 6-7 (which works along with apache for https). 

1) use the following open ssl command in order to produce the p12 keystore file 


openssl pkcs12 -export -in mycert.crt -inkey mykey.key  -out mycert.p12 -name tomcat -CAfile myCA.crt  -caname root -chain

You are going to be asked for an export password which you are going to use in the next step. Just type your password.

2) In ${TOMCAT_HOME}/conf/server.xml change the following lines 

 <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" />

to


  <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
        maxThreads="150" scheme="https" secure="true"
        clientAuth="false" sslProtocol="TLS" 
        SSLCertificateFile="${SSL_CRT_FILE_PATH}" 
        SSLCertificateKeyFile="${SSL_PRIKEY_FILE_PATH}" 
        keystoreFile="${SSL_P12_KEYSTORE_FILE_PATH}" 
        keystorePass="${EXPORT_PASS_IN_STEP_1}" keystoreType="pkcs12"                                                                  />

Restart your tomcat and try it out using 8443 port. (https://localhost:8443/yourAppPath/)
Check tomcat ssl configuration for more information.

Hope this helps you out!
Cheers



Tuesday, 13 August 2013

SSH login without password

Hello,

In order to login using ssh without any password from computer A to computer B please follow the steps:

1) In computer A, open a console and type ssh-keygen -t rsa. Please do not provide any input to the questions that are asked. 
2) In computer B, create a directory as ~/.ssh and set permission to 700
3) In computer A, type cat ~/.ssh/id_rsa.pub | ssh b@B 'cat >> ~/.ssh/authorized_keys'
4)In computer B, set ~/.ssh/authorized_keys file to 640
5) In computer A, check if ssh requires password by typing ssh b@B;

Hope it works for you.

Ps: Thank you Ssh login without password for this valuable information.