rye icon indicating copy to clipboard operation
rye copied to clipboard

Rye should respect ssh_config_options better

Open rickhull opened this issue 10 years ago • 3 comments

My use case for rye is to automate things that I'm doing "manually" via SSH. I have an extensive SSH config (~/.ssh/config) that specifies which keys and users to use for which hosts. I am finding that Rye::Box is not respecting my ssh config. Rye::Box is unaware of the various keys in ~/.ssh and it (obviously) doesn't try to use them when connecting to hosts that specify those keys in ~/.ssh/config.

I did some source diving, and it looks like the only ssh config option that is respected is :port, and to some extent :user. I say "to some extent" because I found in some cases that the user from ~/.ssh/config was not being used, though I see in the source that it should be, via @rye_user. I haven't gotten to the bottom of this yet.

I also use ssh-agent extensively to hold my decrypted private keys in memory. I'm not sure if Rye will use this, and looking at Rye.sshagent_info and @@agent_env -- do these do anything? I see that @@agent_env is initialized to an empty hash -- and then never updated again anywhere.

I really like this project, and I'm eager to use it, but I'm having trouble understanding some of these design decisions. I'd be happy to collaborate and discuss more extensively.

rickhull avatar Dec 01 '15 19:12 rickhull

I figured out the issue with username. Rye::Box works as expected, but Rye::Set does not:

https://gist.github.com/rickhull/9c9c056f040afd11329d

rickhull avatar Dec 01 '15 22:12 rickhull

Hi Rick, thanks for reporting these. I haven't had much time lately to spend on Rye. I'm happy to pull in a patch that pass all tests but unfortunately can't be much in debugging.

delano avatar Dec 06 '15 21:12 delano

Honestly, I probably won't tease this apart either. But it seems clear to me that the Set does not reliably approximate a "set" of boxes. The abstraction leaks.

rickhull avatar Dec 15 '15 06:12 rickhull