Do not feed stdin until interactive
Hey!
When connecting with ssh and a key, you can start typing stuff while authenticating and this will be provided to the next process listening to stdin. When using passh, what is received on stdin seems to be transmitted to the remote end even when not interactive yet. Would it be possible to avoid this?
That's intentional. When you start typing it enters interactive mode automatically. That's because it cannot tell at what time the users want to enter interactive mode. Manual intervention is a reasonable sign. :)
passh is designed to be simple. Try my sexpect (it's simple too) if you want to be more flexbile.
hello @clarkwang This would be a nice feature as it will allow to execute code on remote server like this:
$ cat s.txt
uptime &&
df -h &&
free -m
$ ./passh -p password ssh app.example.com < s.txt
Or i am missing something and it is already possible to send stdin like this. When I am trying to send stdin like this, it is hung after successfully ssh-ing?
Update
just realised README already giving an example for passing stdin with bash -c. So can do this way:
./passh -p password bash -c 'ssh -T app.example.com < s.txt'