ssh command not work in cygwin

10

2

the ssh command is work perfect in my cygwin before. but today it is not work. It always show a usgage. but my command is correct.

$ ssh  root@10.0.0.1
usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
           [-D [bind_address:]port] [-e escape_char] [-F configfile]
           [-I pkcs11] [-i identity_file]
           [-L [bind_address:]port:host:hostport]
           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
           [-R [bind_address:]port:host:hostport] [-S ctl_path]
           [-W host:port] [-w local_tun[:remote_tun]]
           [user@]hostname [command]

$ ssh  -V
OpenSSH_5.6p1, OpenSSL 0.9.8o 01 Jun 2010

cygwin version is 1.7

Thants

Mingo

Posted 2010-09-09T00:06:37.230

Reputation: 403

Did you try reinstalling? – digitxp – 2010-09-09T00:10:30.477

1What has changed in your system between "before" and "today"? – garyjohn – 2010-09-09T01:10:56.540

1Do you have an alias or function called ssh? Check with the command type ssh. – Gilles 'SO- stop being evil' – 2010-09-09T07:07:25.380

@digitxp . yes, i uninstall the openssh and restart windowXP, and then intall openssh. but type ssh root@10.0.0.1, it show me a usage. – Mingo – 2010-09-09T22:45:56.827

@garyjohn, the change is, I install the screen package. before that, ssh client work fine. and now i already unintall the screen package, ssh still not work. – Mingo – 2010-09-09T22:47:44.690

@Gilles, NO. not any alias of ssh. – Mingo – 2010-09-09T22:48:55.793

I can't find or think of an argument to ssh that looks like a host name but gives a usage error instead of an invalid host name error. You might try to verify your ssh installation with one or more of the following commands: cygcheck -c openssh, cygcheck /usr/bin/ssh, cygcheck -v /usr/bin/ssh, ldd /usr/bin/ssh. Maybe the screen installation corrupted one of your libraries. – garyjohn – 2010-09-09T23:45:42.083

Answers

7

I had this problem and was able to resolve it by downgrading my openssh to "OpenSSH_5.5p1, OpenSSL 0.9.8o 01 Jun 2010"

Just open the cygwin setup program and type ssh, then click the version until you see 5.5p1.

jhatfiel

Posted 2010-09-09T00:06:37.230

Reputation: 71

3SWEET CHRIST THANK YOU. That's an hour of my life I'll never get back. – Gavin Gilmour – 2010-10-19T14:02:06.657

2I had a totally different error Pseudo-terminal will not be allocated because stdin is not a terminal, all I had to do was reinstall (not even to a different version) and now it's fine... I don't get it, but okay, ty. – Farzher – 2014-05-22T17:33:59.033

4

In order to get Cygwin to use ssh you must install it with ssh (networking) included. When you get to the dialog where the options to check stuff to install or not appears, type "network" in the search box and look for ssh. You need to select this option for it to be installed.

You will find many basic features need this to be installed.

nicorellius

Posted 2010-09-09T00:06:37.230

Reputation: 5 865

I don't believe that this is correct. The user should only need to select and install the openssh package. The user should then read /usr/share/doc/Cygwin/openssh.README and run /usr/bin/ssh-user-config. – garyjohn – 2010-09-09T01:09:35.373

1I use cygwin routinely and many users in my office do too. If you simply grab the setup.exe and don't do anything, ie, accept defaults, you will not install ssh functionality. You must choose to install it as I described. I have done this numerous times. There may be another way, but when ssh is not available, this ALWAYS works for me on my XP machine. – nicorellius – 2010-09-09T16:15:16.203

I see. I misunderstood your answer to mean you had to select some option or package called "networking" when you installed ssh. The OP has already installed ssh, as you can see from the command output he posted. – garyjohn – 2010-09-09T19:26:58.657

I believe the "Networking" is the subsection in the cygwin installer that contains the ssh package... I could be wrong. – nicorellius – 2010-09-09T19:45:28.697

2

I ran into this just today after using Cygwin primarily for ssh for several years. Turns out that as of a year ago there is an ssh client built into Windows 10. As of the April 2018 Windows 10 update, it is installed and enabled by default.

Just drop into your command line and type your ssh command.

tgmoor

Posted 2010-09-09T00:06:37.230

Reputation: 21

1

On cygwin, try type ssh. If the result is a path like /cygdricve/c/Windows/System32/OpenSSH/ssh you might want to try to use (again) cygwins ssh.exe, by calling "/bin/ssh.exe ... ", or put this as ALIAS in your .bashrc:

alias ssh="/bin/ssh.exe"

Guest

Posted 2010-09-09T00:06:37.230

Reputation: 11