Showing posts with label KnowledgeX. Show all posts
Showing posts with label KnowledgeX. Show all posts

Debugging SSH Digest Login.

I recently when through some issue trying to find out why my SSH digest login did not work. I would like to share this experience. (Assuming that you have root access.)

Before we start off, there are generally 2 kind of ssh daemon, those based on openSSH and based on ssh.com. The difference is in the way these 2 differentiate the public key and the private key.
Hence it is important to know which is which to prevent a headache in troubleshooting it.
(You can use puttygen to find out the difference. Basically they are the same except for the formating.)

I normally use a mixture of putty and Ubuntu ssh (aka openssh ) to navigate around my work servers and my home servers. So I am pretty comfortable with both. To start off, check your sshd.config which is located in /etc/ssh/ in ubuntu. Turn the log level to debug or verbose. If you do not know, do a man on the sshd. It should tell you what sort of values you can put. Then restart your sshd daemon. Otherwise restart your server.

On your own server execute the ssh-keygen and generate your private and public key. Then cat the which is offen in the file of id_rsa.pub into the authorized_keys files within the .ssh directory.
Assuming everything is correct, you can ssh localhost and bypass the login prompt. If it cannot then execute ssh -v localhost to show more information. Still cannot, ssh -vvv localhost. Using the -v, -vv or -vvv options will throw out information with regards to the key exchange between the ssh client and ssh server. From there you will find it easier to debug your ssh digest login failure.

Common Problem:
Usually it is due to permission issue that caused the login to fail. The permission on the home folder also plays a part not just the .ssh directory. It needs to be at least a drwxr-xr-x for the ssh transaction to be successful.

Drop me comments if you want more details.

"I don't think it is a bug.", he said.

So Mr Sun Tech support guy came back from vacation and finally find time to my query. He called and asking plenty of information which I had already provided in my email. The most important question asked was "Can you recreate it?"

An engage debate beings. The debate revolves around, if the person reporting the bug is responsible to prove that the problem happen or should the tech support people be responsible to prove that what i reported was due to the "Stupid user" syndrome. This is similar to how justice is implemented in US and Singapore. You are innocent unless proven guilty by the prosecution vs You are guilty unless the defense proof that you are innocent.

So after the debate. Yes I proofed the scenario is reproducible.
The steps are as follows.

Prerequisites:
Sun Application Server
Oracle DB. (I suspect that it would happen to other DB too.)

Steps in Sequence:
1) Limit the number of concurrent session for a particular db user to eg: 150.
2) Configure the min/max pool size to be the same and large number like 300.
3) Restart the server to have a clean start.
4) Notice that the server starts up fine and then access the application using the connection pool. This will kick start the initialization of the connection pool.
5) Then you will notice that the connection pool will initialize until it is 150. (as define by the DB concurrent session limit)
6) Using the Server monitoring feature, you can observe that the number of connection created was 150.
7) The DB should report 150 at this time too. The strange thing is that, although there are connection in the connection pool, none of them can be use by the application. The application requesting for connection will report that the SQL Exeception that the number of concurrent session for the DB user has exceeded.
8) Then request the DBA to up the number of concurrent session to 500. This is to simulate a situation which the server encounter problem when initializing the connection pool.
9) Try accessing the application again. This time the application will return with the correct and successful results.
10) However using the server monitoring feature, you will realize that the number of connection has exceeded the number which you define. In this example 300. The total number of connection created and in the pool is 450.

Conclusion:
The server failed to completely initialize the pool to the required size and the application server is not smart enough to detect that there are available connections which the web application can still use. When the problem was resolve, the pool is reinitialize. It failed to detect the current state of the connection pool and re-run the initialization process fully. It then establish the x+(steady state connections) where x is the number of connection previously initialized. Eat these! This is a bug. BUG BUG BUG I tell you.

There are however a few question marks. Is the problem caused by having a large number of connection? Is it cause by having the same min max values? If I need to find this out, might as well give me the source code and I fix it for them. Damn it, earn your pay Sun Support Staff. Where is your customer service Sun Microsystems!

Humans make mistakes.

I was browsing through the release notes for the Java 5 release 12 release notes and saw this on the list of bugs being fixed. And I saw this entry

6524112 tooldocs all sloppy developer missed testcase when fixing 6490790

http://java.sun.com/j2se/1.5.0/ReleaseNotes.html#150_12

Human make mistakes.

Car Ownership and Road Availability

If you find that driving in the little red dot is getting more and more unbearable, you are not too far from the truth.

Using the data from @ http://www.lta.gov.sg/corp_info/doc/Stats%20In%20Brief%20(2006).pdf

We have this table.














































Year All Vehicles Motorcycles Road Length Lane Kilometers Vehicle/KM Vehicle/Lane KM
2004 727395 137029 3188 8354 228.17 87.07
2005 754992 139434 3234 8459 233.45 89.25
Delta 27597 2405 46 105 599.93 268.83
So there are 27597 more vehicles on the road. (2 wheeled motorcycles included.) As compared only 105km of roads has been added (not necessary distance from point A to point B. )

For every kilometer of road, there are approx 228 in 2004 and then it increases to 233 in 2005. Well lets discount that most of the time cars are parked in the car park and not all are on the road. If 40% of them are on the road, then it will still be 91 cars on the road in 2004 and 93 cars on the road in 2005.

Ubuntu Edgy Eft on Intel T2400 processor

Haa. Finally understand what all those article in the forum meant. I shall put that down into simple layman terms.

What I was trying to do was to update my standard Edgy Eft installation of Ubuntu to an SMP version of Edgy Eft.

Hardware:
Dell Inspiron 640M/E1405 with a Intel T2400 Duo Core processor.

Steps:
- Using the Synaptic Package Manager. Go to the Base System (Restricted) on the right hand side.
- Mark the Linux package. The description will say complete generic Linux Kernel.
(see the screen shot)
- Install the package and reboot.
- During the boot menu, choose the generic version and boot up that image.
- After system up, execute the command "cat /proc/cpuinfo". You should see 2 cpu registered. Alternatively the system monitor should show 2 cpu instead of 1.
- (Optional) Uncheck the Linux 386 package. Update the "/boot/grub/menu.lst" and remove the 386 option.

Thanks to the folks in the Ubuntu Forums! Thanks to google too!













Now you know too!