JSCH Authentication failure in websphere 6.01

Help
mist1605
2008-10-27
2013-05-28
  • mist1605
    mist1605
    2008-10-27

    Hi All,
    I'm having an application which needs to talk to a SFTP server running in Solaris.
    The test case runs fine with the JSCH talking with the SFTP server outside the Websphere instance.
    But when the application is deployed to the Websphere application server(v6.01) in my windows workstation
    it just fails authenticating(saying com.jcraft.jsch.JSchException: Auth fail).I tried using username and password as well as the public-private key type authentication.Both authentication mechanisms work fine out side the application server.  Can any one give some valuable clues to solve this problem.Is it required to tweak the webshere security to
    enable SFTP to be working or some code changes are required?

    Thanks in advance
    Prem

    Connection code as follows
            
         JSch jsch = new JSch();
             jsch.addIdentity("c:\\id_rsa");
             session = jsch.getSession(_user, _ftpHostUrl, SFTP_PORT);
             Properties config = new Properties();
             config.setProperty("StrictHostKeyChecking", "no");
             config.setProperty("PreferredAuthentications", "publickey");
             session.setConfig(config);
             session.setUserInfo(new MyUserInfo());
             session.connect();
             Channel channel = session.openChannel(SECURE_FTP);
             channel.connect();
             ChannelSftp c = (ChannelSftp)channel;

    Following commands were run in Solaris to generate the key pairs.
    ssh-keygen -t rsa
    cat id_rsa.pub >> authorized_keys