Giter Club home page Giter Club logo

ssh-el's Issues

ssh -i ~/.ssh/identity fails in cygwin emacs as ssh does not do file expansion

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 [email protected] -i ~/.ssh/amazon-devel.pem

Warning: Identity file ~/.ssh/amazon-devel.pem not accessible: No such file or directory.
Permission denied (publickey).

Process *ssh [email protected]* exited abnormally with code 255

But it works from inside a shell

$ ssh -v [email protected] -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....

ssh-parse-words can't handle "-o 'ConnectTimeout 1'"

The following parses correctly:

(ssh-parse-words "192.168.1.6 -l me -o 'RemoteCommand hostname'")
=> ("192.168.1.6" "-l" "me" "-o" "RemoteCommand hostname")

Here is the problem:

(ssh-parse-words "192.168.1.6 -l me -o 'ConnectTimeout 1'")
("192.168.1.6" "-l" "me" "-o" "'ConnectTimeout" "1'")

If I change the 1 to one it parses correctly (but, of course, this will not be accepted by ssh itself):

(ssh-parse-words "192.168.1.6 -l me -o 'ConnectTimeout one'")
("192.168.1.6" "-l" "me" "-o" "ConnectTimeout one")

I guess the regular expression in ssh-parse-words needs to be adjusted, but regexs are a black art to me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.