I have two PC's both running Windows 7 (64 bit).

I installed CYGWIN (64 bit) on them today simply for the SSH functionality. (I want to use a file sync program called Unison and Unison recommends the CYGWIN ssh).

I have done ssh-host-config and ssh-keygen. I also changed the sshd_config file to include: PasswordAuthentication yes (instead of being commented out) I restarted sshd after the config change.

On both machines, I can do:

ssh localhost 

and login in no problem using the Windows password for that machine. After the login, it shows me the user and host's name at the localhost's CYGWIN prompt.

However, when I do....

ssh theotherbox -l user@theotherbox

(using the values for the and I saw in the localhost's CYGWIN prompt above), then I always get:

Permission denied, please try again.

I am running Comodo Firewall on both boxes, and the first time I attempted this, Comodo asked if it should allow the incoming connection. I said YES and remember that answer. So I don't think the firewall is part of the problem. (Unless there is something I need to allow in the firewall on the origin computer's setup?)

Since the ssh login on localhost works, I am not sure what to look at or how to resolve this next.



ssh theotherbox -l user@theotherbox

This isn't the right syntax to specify a username and a hostname. ssh may be using "user@theotherbox" as a username, which is likely to fail.

The correct syntax is either:

ssh -l user host


ssh user@host
| improve this answer | |
  • OK, I copied that ssh command format from the Unison documentation. Using the "-l" param anywhere in the command line has no effect on the results; still "permission denied". However, your second idea worked: "ssh user@hostname" that got it working. Thanks. – mkstreet Jun 30 '14 at 23:21
  • With the "-l" form, the order of the parameters isn't the issue. The issue is that "-l" specifies the username. So "ssh theotherbox -l user@theotherbox" says to log into theotherbox as a user named "user@theotherbox". – Kenster Jul 1 '14 at 1:24

The problem lies in your user name. If you login locally Windows is not case sensitive. But if you login "remotely" you have to take care of it. You must write the user name exactly how it was defined in Windows.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.