top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

Getting "JSchException: Auth fail" with correct Username and Password

+2 votes

Why I am getting this error? Please help.

Exception in thread "main" com.jcraft.jsch.JSchException: Auth fail
    at com.jcraft.jsch.Session.connect(
    at com.jcraft.jsch.Session.connect(
    at LabManagement.main(
posted Dec 17, 2013 by Satyabrata Mahapatra

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
Can you please provide more detail i.e. what is the context what you tried etc...
Both issue are different. I was trying to connect to a remote machine by JSch. But "session.connect()" was throwing exception.

1 Answer

+1 vote

I solved this issue by flushing iPTables(iptables -F). Works for me!!
Trying to figure out Why.

answer Dec 18, 2013 by Satyabrata Mahapatra
This exception occurs whenever jsch.Session.connect fails, most common reason is password is wrong and others could be the obviously connectivity issue.

IPfilters blocks the traffic to the machine based on the settings and flush will clear them all so :)
can you elaborate how do we do that ? flushing table
Similar Questions
0 votes

I was playing with the permissions of


Could someone please tell me the commands to restore the correct permissions to those both directories?

Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.