#40 Passwd expired on AIX:No exception thrown session.connect

open
nobody
None
5
2008-12-16
2008-12-16
mariag
No

Hello,
on aix platform (using open ssh) no exception is thrown to notify my application if the password used to establish the ssh connection is expired. The problem does not occur on other unix boxes.
This is the source of code I've at the moment:
...............
package com.customSecurity.sample;

import com.jcraft.jsch.JSch;
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;

public class TestSSH {

private final int TIMEOUT = 1500;
public boolean openSshConnection(String user, String password) {

Session session = null;
try {
JSch jsch = new JSch();
session = jsch.getSession(user, "r22p02.tod.com", 22);
session.setTimeout(TIMEOUT);
com.jcraft.jsch.UserInfo ui = new TpmUserInfo(password);
session.setUserInfo(ui);
session.connect();
} catch (JSchException e) {
System.out.println("Authentication error opening ssh session on port" + 22);
System.out.println("Reason: "
+ e.getMessage());
return false;
} finally {

if (session != null)
session.disconnect();
}
return true;
}
/**
* @param args
*/
public static void main(String[] args) {
try {
TestSSH osim = new TestSSH();
osim.openSshConnection("admin", "Pwd");
} catch (Exception ex) {
System.out.println ("Exception: " + ex.getMessage());
}

}

}
.......................

The UserAuthPassword class checks if the SSH_MSG_USERAUTH_PASSWD_CHANGEREQ is returned but no exception is returned .

Thanks in advance
Maria

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks