textmate / rmate

Edit files from an ssh session in TextMate
http://blog.macromates.com/2011/mate-and-rmate/
514 stars 81 forks source link

SSH Tunneling Problems #29

Closed ylluminate closed 10 years ago

ylluminate commented 10 years ago

I am having an odd issue wherein suddenly port forwarding stopped working in a particular scenario for me. By default I have ssh set to use the following config (my ~/.ssh/config file):

Host *
    ControlMaster auto
    ControlPath /tmp/%r@%h:%p
    ServerAliveInterval 120
    ServerAliveCountMax 3

    ForwardX11 yes
    ForwardX11Trusted yes

    RemoteForward 52698 127.0.0.1:52698

I then initiate ssh to the server (ssh username@server.tld) and query my local workstation to make sure that there are listeners for port 52698; sudo lsof -i -P | grep 52698:

AppName   40262        username   45u  IPv6 0x4b497d2de68055a1      0t0    TCP *:52698 (LISTEN)
sshd      92207        username   14u  IPv6 0x4b497d2d9e7ec4a1      0t0    TCP localhost:52698 (LISTEN)
sshd      92207        username   15u  IPv4 0x4b497d2dbb985641      0t0    TCP localhost:52698 (LISTEN)

I then likewise make sure that the port is active on the server, lsof -P | grep 52698:

sshd      16366      root    7u     IPv6             196798        0t0        TCP localhost:52698 (LISTEN)
sshd      16366      root    8u     IPv4             196799        0t0        TCP localhost:52698 (LISTEN)

I simply get hangs or effective timeouts right now when I initiate rmate.sh on the server to which I'm logged into in each case. With the rb version of rmate I'm getting the following error which leads me to believe that something is wrong with the tunnel now:

[~]# /usr/local/rvm/gems/ruby-1.9.3-p448@global/gems/rmate-1.5.5/bin/rmate:149:in `readline': end of file reached (EOFError)
    from /usr/local/rvm/gems/ruby-1.9.3-p448@global/gems/rmate-1.5.5/bin/rmate:149:in `connect_and_handle_cmds'
    from /usr/local/rvm/gems/ruby-1.9.3-p448@global/gems/rmate-1.5.5/bin/rmate:186:in `block in <top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.3-p448@global/gems/rmate-1.5.5/bin/rmate:185:in `fork'
    from /usr/local/rvm/gems/ruby-1.9.3-p448@global/gems/rmate-1.5.5/bin/rmate:185:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.3-p448@global/bin/rmate:19:in `load'
    from /usr/local/rvm/gems/ruby-1.9.3-p448@global/bin/rmate:19:in `<main>'
    from /usr/local/rvm/gems/ruby-1.9.3-p448@global/bin/ruby_noexec_wrapper:14:in `eval'
    from /usr/local/rvm/gems/ruby-1.9.3-p448@global/bin/ruby_noexec_wrapper:14:in `<main>'

I also did set /etc/rmate.rc to this for good measure:

port: 52698

Any ideas here as to what may be going on or any way to coax rmate.rb to offer some more insight on the connectivity issue?

sorbits commented 10 years ago

On your remote host you can run:

telnet 127.0.0.1 52698

This should connect to TextMate (on your Mac, via the tunnel). If that fails, the tunnel is not working.

redbar0n commented 10 years ago

Noob tip that I found useful: Remember to have Textmate running on your local machine.

sorawee commented 9 years ago

@redbar0n Yes! I forgot to open Textmate! Thank you!

redbar0n commented 9 years ago

@sorawee I'm glad it helped someone other than me as well. :-)

axis80 commented 6 years ago

Google brought me here too. Doh!