IIRC, when I wrote the example, I used passwordless connections, using a private key file.
ssh doesn't ask for a password through a "virtual" console like a pipe, but it wants a real console.google on ssh-askpass, maybe it helps
In a different thread, I already announced that the examples for TProcess (on Lazarus web site) are not working. I used those examples to run ssh.
program launchprogram; uses Classes, SysUtils, Process; var AProcess: TProcess; AStringList: TStringList; begin AProcess := TProcess.Create(nil); AStringList := TStringList.Create; AProcess.CommandLine := 'ssh'; AProcess.Options := AProcess.Options + [poWaitOnExit, poUsePipes]; AProcess.Execute; AStringList.LoadFromStream(AProcess.Output); writeln(AStringList.text); AStringList.Free; AProcess.Free; end.
[marc@giant procout]$ ./procoutlarge "ls -al"-- executing --.-- executed ---- linecount = 10 --| total 868| drwxrwxr-x 2 marc marc 4096 2009-10-20 15:41 .| drwxr-xr-x 142 marc marc 20480 2009-10-12 23:16 ..| -rw-rw-r-- 1 marc marc 16 2004-09-30 19:49 out.txt| -rw-rwxr-x 1 marc marc 386616 2004-09-30 19:44 procout| -rwxrwxr-x 1 marc marc 441976 2009-10-20 15:41 procoutlarge| -rw-rw-r-- 1 marc marc 7096 2009-10-20 15:41 procoutlarge.o| -rw-rw-r-- 1 marc marc 2015 2004-12-28 22:34 procoutlarge.pp| -rw-rw-r-- 1 marc marc 2016 2004-12-28 22:34 procoutlarge.pp.bak| -rw-rw-r-- 1 marc marc 609 2004-09-30 19:44 procout.pp-- end --
[marc@giant procout]$ ./procerrlarge "ssh -V"-- executing --.-- executed ---- linecount = 1 --| OpenSSH_4.7p1, OpenSSL 0.9.8b 04 May 2006-- end --