max-mapper / linux

run Linux on Yosemite easily from the CLI
http://hyperos.io/
458 stars 22 forks source link

`linux ssh` doesn't work (El Capitan?) #11

Closed mathie closed 9 years ago

mathie commented 9 years ago

This is probably the least useful bug report ever, but I thought I'd throw it out there, see if anyone else was seeing the same symptoms. Running on the GM seed of El Capitan, I've got a VM booting and it appears to be running (ps, status, etc work fine). However linux ssh just ... hangs -- doesn't exit, and doesn't give me a shell on the VM. I'm intuiting that the ssh connection has been established, since hitting ctrl-c doesn't do anything, but typing the ssh escape sequence (`\n~.') closes the ssh connection and exits.

Interestingly, if I run the following:

ssh -v -i $(pwd)/linux/id_rsa tc@$(linux ip)

it works, and I get a shell on the VM! Curious, eh?

Is there something I can do to furnish you with a more helpful bug report?

mafintosh commented 9 years ago

does linux run echo hello world do anything?

mathie commented 9 years ago

It doesn't output anything, but it exits cleanly:

> linux run echo hello world
> echo $?
0

sshing manually does have the desired effect:

> ssh -i $(pwd)/linux/id_rsa tc@$(linux ip) echo hello world
hello world

Would that suggest it's something to do with node wiring up the tty?

mafintosh commented 9 years ago

yes i think so - let me add some debugging output to ssh real quick

mafintosh commented 9 years ago

could try upgrading to 2.6.0 (latest) and run linux ssh --debug? that should print the ssh command it is trying to spawn. maybe that will help us

mathie commented 9 years ago

Ah, now that's interesting. The problem appears to be down to my ssh configuration. I have ssh configured to multiplex sessions over a single connection -- mostly because it speeds up interaction with GitHub a little bit. Here's my configuration:

Host *
  # Multiplex several connections to the same host over the same channel.
  ControlMaster auto
  ControlPersist 600
  ControlPath ~/.ssh/control/%r@%h:%p.sock

If I disable that, then linux ssh works. With it enabled, running linux ssh --debug gives me:

> linux ssh --debug                                                  
spawning ssh [ '-v',                                                 
  '-i',                                                              
  '/Users/mathie/Development/Personal/linux/linux/id_rsa',           
  '-o',                                                              
  'StrictHostKeyChecking=no',                                        
  '-o',                                                              
  'LogLevel=ERROR',                                                  
  'tc@192.168.64.4' ]                                                
OpenSSH_6.9p1, LibreSSL 2.1.7                                        
debug1: Reading configuration data /Users/mathie/.ssh/config         
debug1: /Users/mathie/.ssh/config line 12: Applying options for *    
debug1: Reading configuration data /etc/ssh/ssh_config               
debug1: /etc/ssh/ssh_config line 21: Applying options for *          
debug1: auto-mux: Trying existing master                             
debug1: mux_client_request_session: master session id: 2             

(I took the liberty of adding -v to the ssh flags, too.) However, running exactly the same ssh command directly from the command line works:

> ssh -v -i /Users/mathie/Development/Personal/linux/linux/id_rsa -o StrictHostKeyChecking=no -o LogLevel=ERROR tc@$(linux ip)
OpenSSH_6.9p1, LibreSSL 2.1.7                                                                                          
debug1: Reading configuration data /Users/mathie/.ssh/config                                                           
debug1: /Users/mathie/.ssh/config line 12: Applying options for *                                                      
debug1: Reading configuration data /etc/ssh/ssh_config                                                                 
debug1: /etc/ssh/ssh_config line 21: Applying options for *                                                            
debug1: auto-mux: Trying existing master                                                                               
debug1: mux_client_request_session: master session id: 2                                                               
 __    __    __                                                                                                        
/  \__/  \__/  \__   Welcome to HyperOS Linux! (Based on TinyCore Linux)                                               
\__/  \__/  \__/  \        hyperos.io              tinycorelinux.net                                                   
   \__/  \__/  \__/                                                                                                    

tc@boots-felix-buddy-peanut:~$                                                                                         

Weird, huh? I think that's enough to help me work around the problem, and we can probably put it down to a weird edge case configuration that's unlikely to trip anyone else up! Thank you for your prompt assistance! :smile:

max-mapper commented 9 years ago

@mathie nice sleuthing. we have talked about shipping our own ssh client for this reason, might get around to it someday!