Updating the firmware on an N95-2 will reset the security code to 12345.
However, your original query wasn't that clear. Is it the phone's security code you're asking for or the unlock code that allows you to use SIM cards from networks other than the original one the phone was used on (so-called restriction code)? Only the original network can provide the restriction code.
Also make sure that it is in fact a genuine N95-2 that you have. There are countless fakes on sale on eBay.
Was this post helpful? If so, please click on the white "Kudos!" star below. Thank you!