0

I want to change a password on a remote UNIX server by a java program without user interaction. I had no problem doing this with JSch in my test environment using ChannelShell - this works perfectly. But the production target system doesn't allow to run the shell, so I have to do this using ChannelExec providing the passwords (old and new) by streams to the terminal.

Does anyone have a sample code for changing the password without user interaction using ChannelExec?

By the way, the target system has a special command for changing the password, not the usual passwd command - so I suppose, that I won't have the usual options (like --stdin) for this command, too.

Thanks, Robert

  • Found a solution here: http://stackoverflow.com/questions/18407089/take-commandspassword-from-string-and-set-as-inputstream-to-unix-servers-in-ja?lq=1 – Robby Tobby Dec 22 '14 at 13:05
  • Again, the found solution works in my test environment, but not against the target system. Maybe there are some other solutions... – Robby Tobby Dec 22 '14 at 13:55

0 Answers0