Discussion:
[JSch-users] com.jcraft.jsch.JSchException: Auth fail
Dean Pullen
2006-07-25 14:25:39 UTC
Permalink
I know this is covered in the mailing lists but I've still not come to
a conclusion on how to fix it.

com.jcraft.jsch.JSchException: Auth fail occurs when I run the scp ant task.

PasswordAuthentication is set to yes in /etc/ssh/sshd_config

And yes, UserAuthKI.java works when run.

Any ideas? Thanks in advance,

Dean.
Adam Gordon
2006-07-25 15:00:57 UTC
Permalink
Dean-

What's your ant task look like?

cheers,

-Adam
Post by Dean Pullen
I know this is covered in the mailing lists but I've still not come to
a conclusion on how to fix it.
com.jcraft.jsch.JSchException: Auth fail occurs when I run the scp ant task.
PasswordAuthentication is set to yes in /etc/ssh/sshd_config
And yes, UserAuthKI.java works when run.
Any ideas? Thanks in advance,
Dean.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
JSch-users mailing list
https://lists.sourceforge.net/lists/listinfo/jsch-users
Dean Pullen
2006-07-25 15:06:59 UTC
Permalink
Here it is:

<scp todir="username:password@:host"
trust="yes"
verbose="true">
<fileset dir="temp/eardir">
<include name="*.xml"/>
<include name="earname.ear"/>
</fileset>
</scp>

Obviously I've replaced the original values.
Adam Gordon
2006-07-25 15:28:15 UTC
Permalink
Dean-

A couple of things I see right off the bat:

1. I believe the colon before "host" is out of place...should be
after....along with a destination directory/path...

Also, as a test, make sure you can ssh into "host" using the specified
username and password as a sanity check.

cheers,

-Adam
Post by Dean Pullen
trust="yes"
verbose="true">
<fileset dir="temp/eardir">
<include name="*.xml"/>
<include name="earname.ear"/>
</fileset>
</scp>
Obviously I've replaced the original values.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
JSch-users mailing list
https://lists.sourceforge.net/lists/listinfo/jsch-users
Adam Gordon
2006-07-25 17:22:10 UTC
Permalink
Dean-

Hmmm. That's odd....

Try breaking out the parameters in "todir," i.e., use the "password"
attribute. Also try to just copy one file, ala:

<scp file="myfile.txt" password="moo" todir="***@somehost:/home/chuck"/>

If those don't work then I'm out of ideas....other than trying key-based
authentication...but I've had mixed results with that too...

Looking at my sshd_config file, a few other things:

1. Do you use PermitEmptyPasswords? Is your password empty?
2. You might also want to change the LogLevel to something more fine
and then run the scp task to see if it's failing on the ssh side or the
scp-task side.
3. sshd is runing on port 22, right?

-adam
Yes I definitely can SSH to the host using the username password combo
I'm using in the deploy script.
My mistake about the colon, its a typo - it isn't actually there in
the file.
Post by Adam Gordon
Dean-
1. I believe the colon before "host" is out of place...should be
after....along with a destination directory/path...
Also, as a test, make sure you can ssh into "host" using the specified
username and password as a sanity check.
cheers,
-Adam
Post by Dean Pullen
trust="yes"
verbose="true">
<fileset dir="temp/eardir">
<include name="*.xml"/>
<include name="earname.ear"/>
</fileset>
</scp>
Obviously I've replaced the original values.
-------------------------------------------------------------------------
Post by Dean Pullen
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to
share your
Post by Dean Pullen
opinions on IT & business topics through brief surveys -- and earn
cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Post by Dean Pullen
_______________________________________________
JSch-users mailing list
https://lists.sourceforge.net/lists/listinfo/jsch-users
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
JSch-users mailing list
https://lists.sourceforge.net/lists/listinfo/jsch-users
Dean Pullen
2006-07-26 07:56:59 UTC
Permalink
That sort of playing around with the xml params doesn't work, tried it already.
Yep, port 22.

But...

Set PermitEmptyPasswords to yes and it worked....even though the
password is not empty...
Post by Adam Gordon
Dean-
Hmmm. That's odd....
Try breaking out the parameters in "todir," i.e., use the "password"
If those don't work then I'm out of ideas....other than trying key-based
authentication...but I've had mixed results with that too...
1. Do you use PermitEmptyPasswords? Is your password empty?
2. You might also want to change the LogLevel to something more fine
and then run the scp task to see if it's failing on the ssh side or the
scp-task side.
3. sshd is runing on port 22, right?
-adam
Yes I definitely can SSH to the host using the username password combo
I'm using in the deploy script.
My mistake about the colon, its a typo - it isn't actually there in
the file.
Post by Adam Gordon
Dean-
1. I believe the colon before "host" is out of place...should be
after....along with a destination directory/path...
Also, as a test, make sure you can ssh into "host" using the specified
username and password as a sanity check.
cheers,
-Adam
Post by Dean Pullen
trust="yes"
verbose="true">
<fileset dir="temp/eardir">
<include name="*.xml"/>
<include name="earname.ear"/>
</fileset>
</scp>
Obviously I've replaced the original values.
-------------------------------------------------------------------------
Post by Dean Pullen
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to
share your
Post by Dean Pullen
opinions on IT & business topics through brief surveys -- and earn
cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Post by Dean Pullen
_______________________________________________
JSch-users mailing list
https://lists.sourceforge.net/lists/listinfo/jsch-users
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
JSch-users mailing list
https://lists.sourceforge.net/lists/listinfo/jsch-users
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
JSch-users mailing list
https://lists.sourceforge.net/lists/listinfo/jsch-users
Dean Pullen
2006-07-26 08:52:00 UTC
Permalink
Thanks for your help, another colleague has previously patched the jar
to include the patch and we're now using that.
Hi,
|_Date: Tue, 25 Jul 2006 15:25:39 +0100 ________
|
|I know this is covered in the mailing lists but I've still not come to
|a conclusion on how to fix it.
|com.jcraft.jsch.JSchException: Auth fail occurs when I run the scp ant task.
|PasswordAuthentication is set to yes in /etc/ssh/sshd_config
How about 'UsePAM' in '/etc/ssh/sshd_config'?
|And yes, UserAuthKI.java works when run.
The scp task included in Ant 1.6.5 does not support the keyboard-interactive
authentication method. Try nightly builds[1]. The code[2] for that method
has been already committed to its SVN repository.
[1] http://svn.apache.org/snapshots/ant/
[2] http://marc.theaimsgroup.com/?l=ant-dev&m=111959408515300&w=2
Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
+1-415-578-3454
Fax +81-22-224-8773
Skype callto://jcraft/
Atsuhiko Yamanaka
2006-07-26 08:49:21 UTC
Permalink
Hi,

+-From: "Dean Pullen" <***@gmail.com> --
|_Date: Tue, 25 Jul 2006 15:25:39 +0100 ________
|
|I know this is covered in the mailing lists but I've still not come to
|a conclusion on how to fix it.
|com.jcraft.jsch.JSchException: Auth fail occurs when I run the scp ant task.
|PasswordAuthentication is set to yes in /etc/ssh/sshd_config

How about 'UsePAM' in '/etc/ssh/sshd_config'?

|And yes, UserAuthKI.java works when run.

The scp task included in Ant 1.6.5 does not support the keyboard-interactive
authentication method. Try nightly builds[1]. The code[2] for that method
has been already committed to its SVN repository.

[1] http://svn.apache.org/snapshots/ant/
[2] http://marc.theaimsgroup.com/?l=ant-dev&m=111959408515300&w=2

Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
+1-415-578-3454
Fax +81-22-224-8773
Skype callto://jcraft/
Atsuhiko Yamanaka
2006-07-28 05:41:38 UTC
Permalink
Hi,

+-From: "Dean Pullen" <***@gmail.com> --
|_Date: Tue, 25 Jul 2006 15:25:39 +0100 ________
|
|I know this is covered in the mailing lists but I've still not come to
|a conclusion on how to fix it.

|com.jcraft.jsch.JSchException: Auth fail occurs when I run the scp ant task.

|PasswordAuthentication is set to yes in /etc/ssh/sshd_config

|And yes, UserAuthKI.java works when run.

May I ask you to try UserAuthKI.java again with enabling following lines
in 'promptKeyboardInteractive' method ?

System.out.println("destination: "+destination);
System.out.println("name: "+name);
System.out.println("instruction: "+instruction);
System.out.println("prompt.length: "+prompt.length);
System.out.println("prompt: "+prompt[0]);

Will that method really be invoked,? If invoked, one time or two time?


Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
+1-415-578-3454
Fax +81-22-224-8773
Skype callto://jcraft/

Loading...