Archives

All posts for the month July, 2011

Ever needed to remove a SSH key from your authorized_keys file.  Doesn’t much matter for a couple of hosts, as vi will work fine for that.  But what about 1000+ hosts?

You don’t have to put the whole key in there, you can select a random part of the key, just make sure it doesn’t pull anything more than what you want..

I tried putting the full key on this post , but it came out crazy will need to find a better way to post this so that wordpress doesn’t go nutz with it…lol

Continue Reading

 

 

 

 

 

 

SSL and AD Remote loader.

Will need to clean up this article posting for reference.

Using Java SSL (JSSE) with the DirXML Remote Loader
This document assumes you are already familiar with setting up SSL between the DirXML Engine and the DirXML Remote Loader using Key Material Objects (KMOs).

Setting up the Remote Loader side is the same as setting up SSL using KMOs. Simply export your tree CA’s self-signed certificate and use the Remote Loader wizard to import the tree CA’s self-signed certificate.

Setting up the DirXML Engine side to use JSSE consists of two steps:
Create a server certificate in a Java keystore file.
Set up the Remote Loader connection parameters string on the DirXML Engine side so that the keystore file is used rather than a KMO.

The tasks are presented in detail below.

The tools used to complete the tasks are the Java keytool program and Novell’s iManager. You can obtain keytool either by downloading the Java JRE or by using the JRE that comes with the DirXML Remote Loader (c:\novell\RemoteLoader\jre\bin\keytool.exe).

For more information on keytool see http://java.sun.com/products/jdk/1.2…s/keytool.html
Tasks
Create a server certificate in a Java keystore file
If you have already exported your tree’s Certificate Authority self-signed certificate (and can remember where you saved it), skip to step c. Otherwise complete step b.
Export the self-signed certificate from your tree’s Certificate Authority in base-64 format.
In iManager, select the eDirectory Administration/Modify Object task.
Browse to your tree’s Certificate Authority. Click OK.
Click on the Certificates tab.
Click on Self Signed Certificate
Click on the Export button.
In response to the question Do you want to export the private key with the certificate? select No and click Next.
Select File in Base64 format and click Next.
Click on Save the exported certificate to a file.
Import your tree’s self signed certificate into a new keystore file:
keytool –import –file <name of cert file> -trustcacerts –noprompt –keystore <filename> -storepass <password>.
example: keytool –import –file tree_ca_root.b64 –trustcacerts –noprompt –keystore dirxml.keystore –storepass novell
Generate a key pair in the keystore:
keytool –genkey –alias dirxml_key –keyalg RSA –keysize 2048 –dname “<dn of your server>” –keypass <password> -keystore <filename> -storepass <password>
example: keytool –genkey –alias dirxml_key –keyalg RSA –keysize 2048 –dname “cn=perin_nt1-tao.o=novell.t=perin-tao” –keypass novell –keystore dirxml.keystore –storepass novell
Create a certificate signing request for the key pair just generated:
keytool –certreq –alias dirxml_key –file <filename> -keypass <password> -keystore <filename> -storepass <password>
example: keytool –certreq –alias dirxml_key –file certreq.b64 –keypass novell –keystore dirxml.keystore –storepass novell
Issue a certificate using your tree’s Certificate Authority:
In iManager, select the Novell Certificate Server/Issue Certificate task.
In the Filename field enter the name of the file output file specified in the previous step (certreq.b64 in the example). Click Next.
Select the button labeled SSL or TLS and click Next.
On the Certificate Parameters Page click Next.
On the Save Certificate page leave the File in binary DER format button checked and click Next.
Click on Download the issued certificate.
Save the certificate file.
Import the issued certificate into the keystore file:
keytool –import –file <issued cert file> -alias dirxml_key –keypass <password> -keystore <filename> -storepass <password>
example: keytool –import server_cert.der –alias dirxml_key –keypass novell –keystore dirxml.keystore –storepass novell
Copy the keystore file either into the dib directory on the server or to another convenient location on the server hosting the DirXML engine. The dib directory is located in the following locations on the various DirXML-supported platforms:
Win32 – c:\novell\nds\dibfiles
NetWare – SYS:\_NETWARE
Solaris/Linux – /var/nds/dib
Set up the remote loader connection parameter string
In iManager select the driver you wish to configure.
In the Remote loader connection parameters field enter the following.
hostname <name or IP of remote host> port <port number> keystore =keystore file> key=dirxml_key keypass=<password> storepass=password
example: hostname=192.168. 0.1 port=8090 keystore=dirxml.keystore key=dirxml_key keypass=novell storepass=novell
Note: If you copied the keystore file to a location other than the dib directory then you must specify the complete path to the keystore file (e.g., keystore=SYS:\keystore\dirxml.keystore if you copied the keystore file to a directory named SYS:\keystore directory on NetWare).

 

OpenLdap

Recently had to compile a much older version of OpenLDAP version 2.2.24 on relatively newer distro, in this case, SLES 11.  I couldn’t find any working RPMs for this older software, so I decided to compile from src.

Here’s what I did, maybe this could help someone else..

Download Berkley DB, Oracle now owns Berkley DB which used to be owned by SleepyCat.  Anyhow Oracle now charges for the newer copies of BerkleyDB (DAMN Oracle!) but you still can grab the older versions under GPL.

$ cd /tmp

$ wget http://download.oracle.com/berkeley-db/db-4.3.29.tar.gz

$ tar -xvzf db-4.3.29.tar.gz

$ cd /tmp/usr/local

$ mv BerkeleyDB.4.3 /usr/local

To get OpenLDAP 2.2.24 to compile, had to setup some environment varibles first..

To make and install: