Execute "ssh-host-config" from Windows command-line (or from a C program)

Dave Korn dave.korn@artimi.com
Mon Apr 2 17:19:00 GMT 2007

On 02 April 2007 13:39, Fabio Román Arbelo wrote:

> Hi!
> I've been trying to launch the "ssh-host-config" from a Windows
> command-line without success. I've been looking Cygwin mailing-list but
> I haven't found anything that solves my problem. For example, I've tried
> this:
>     c:\cygwin\bin> bash -c '"`/bin/ssh-host-config -y -c "ntsec" -p 10000`"'
> And this is what I got:
>     /bin/ssh-host-config: line 110: uname: command not found
>     /bin/ssh-host-config: line 111: expr: command not found
>     /bin/ssh-host-config: line 113: [: -gt: unary operator expected
>     ...
>     /bin/ssh-host-config: line 424: [: -gt: unary operator expected
>     ...
>     WARNING: Adding ssh to   failed!
>     Host configuration finished. Have fun!: No such file or directory

  Right, that's what you'd expect, because the backticks mean "execute this
command, then substitute all the output it generates in place on the command
line".  So you're telling bash to run ssh-host config and then treat all the
messages it outputs as commands to execute!

  Also, because you didn't pass --login to bash, it hasn't run .bashrc or any
of the other things that would set the path, which might account for some of
the 'command not found' problems.

  Also, you just trashed ssh-host-config by using u2d when what was suggested
was in fact d2u.  You'd better go and d2u it now.  Perhaps twice, just to be
on the safe side.  Then try that first command again, but remove the

Can't think of a witty .sigline today....

Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

More information about the Cygwin mailing list