Using cygwin's latest emacs, 24.5.1 (i686-pc-cygwin) of 2015-06-23...
M-x ssh -i ~/.ssh/<identityfile> fails even as M-x ssh -i C:\Users\Jerry\.ssh\<identityfile> succeeds
Oddly enough, under NT Emacs, that is, the native emacs windows port, M-x ssh -i ~/.ssh/<identityfile> seems to work.
I tried to use ssh -i to ssh into an amazon ec2 instance.
M-x
ssh arguments (hostname first) ssh ubuntu@ec2-....us-west-2.compute.amazonaws.com -i ~/.ssh/amazon-devel.pem
Warning: Identity file ~/.ssh/amazon-devel.pem not accessible: No such file or directory.
Permission denied (publickey).
Process *ssh ubuntu@ec2....us-west-2.compute.amazonaws.com* exited abnormally with code 255
But it works from inside a shell
$ ssh -v ubuntu@ec2....us-west-2.compute.amazonaws.com -i ~/.ssh/amazon-devel.pem
OpenSSH_7.1p1, OpenSSL 1.0.2e 3 Dec 2015
debug1: Reading configuration data /c/Users/Jerry/.ssh/config
debug1: Connecting to ec2...] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/Jerry/.ssh/amazon-devel.pem type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/Jerry/.ssh/amazon-devel.pem-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 pat OpenSSH_6.6.1* compat 0x04000000
...
debug1: Entering interactive session.
Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 3.13.0-48-generic x86_64)
...
Last login: Sat Jan 16 22:26:25 2016
ubuntu@ip:~$
...
I believe the issue is that the elisp ssh is not doing the file name expansion that the shell does before exec'ing the actual ssh.
I think this is an issue because
- ssh is an interactive command and so should handle the common ways that emacs users would try to use ssh based on their experiences.
- and very little else about cygwin emacs requires windows style paths and well, I don't think ssh should either....