in reply to ssh session

Have you looked into Net::SSH it uses keys instead of a password.

Not sure is this will help, but good luck.

sk