how to send password to Cygwin command?

S

sean

All,

I'm trying to write a java program to execute some cygwin rsync calls
using Runtime.getRuntime().exec etc. How do I send a password to the
process that I'm running? Sending via the usual streams doesn't seem
to work.

Thanks,
Sean
 
T

Thomas Weidenfeller

sean said:
I'm trying to write a java program to execute some cygwin rsync calls
using Runtime.getRuntime().exec etc. How do I send a password to the
process that I'm running? Sending via the usual streams doesn't seem
to work.

It is typical that such tool open the terminal device directly, instead
of using stdin/stdout, so you can't provide the password that way.
However rsync allows you to provide the password in at least two other
ways.

man rsync

tells you more.

Alternatively, you could use rsync over ssh with public key
authentication, so you are not asked for a password.

/Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top