IP addresses with VPN, and "kinit -xa"

I'm working from home now, connecting to the office network thru VPN. Running 'ifconfig -a' does not show the IP address for the VPN, although I can find it by using "who" in a SSH session into a office machine or simply look at the Shimo statistics pane.

But here comes a problem, Java's Kerberos uses the following method to fill addresses into the AS-REQ message when requesting the initial TGT from a KDC (which is in the office):
InetAddress.getAllByName(InetAddress.getLocalHost().getHostName())
and it cannot find the VPN IP. So if I use this TGT to request for a service ticket, an error is returned: Incorrect net address.

To solve this problem, I write a patch for Kinit.java in Java, creating a new option "-xa address" which adds an extra address into AS-REQ (this option can be provided more than once). The option "-a" is also added into Klist.java to print the addresses for a ticket. Everything works now.

BTW, I don't like the decision that Sun removed kinit and klist tools from JDK/JRE on Linux and Solaris. They're still very useful. On the other hand, on Windows, these tools exist. But any one who has downloaded MS's own klist.exe will find himself confused all the time: Sun's klist.exe shows ticket cache from the %HOME%/krbccc_xxx file, and MS's klist.exe shows the LSA cache, totally different content.
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

This blog has a comments managing system that requires me to approve each comment manually. Please do not re-post and I will reply it (if I have an answer) when I get pinged.

Search

Top Tags
Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today