Repository navigation
Closed
Labels
bugSomething isn't working
Description
Rig is trying to be too clever with getting host settings from the ssh config by first querying for host:port and if that fails, by trying host only.
The alias/pattern/key in ssh config is not host:port. In fact, you can have something like:
Host 127.0.0.1:33
HostName 127.0.0.1
Port 45
==>
$ ssh -v 127.0.0.1:33
debug1: Reading configuration data /Users/kimmo/.ssh/config
debug1: /Users/kimmo/.ssh/config line 7: Applying options for 127.0.0.1:33
debug1: /Users/kimmo/.ssh/config line 18: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 47: Applying options for *
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 45.The port is only parsed from -p:
$ ssh -v root@127.0.0.1:33 -p 2222
debug1: Reading configuration data /Users/kimmo/.ssh/config
debug1: /Users/kimmo/.ssh/config line 7: Applying options for 127.0.0.1:33
debug1: /Users/kimmo/.ssh/config line 13: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 47: Applying options for *
debug1: Connecting to 127.0.0.1 port 2222.
$ ssh -v 127.0.0.1:12345 -p33
debug1: Reading configuration data /Users/kimmo/.ssh/config
debug1: /Users/kimmo/.ssh/config line 13: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 47: Applying options for *
debug1: resolve_canonicalize: hostname 127.0.0.1:12345 is an unrecognised address
debug1: Connecting to 127.0.0.1:12345 port 33.So, in the case of config like this:
ssh:
address: 127.0.0.1
port: 40
user: bobAnd ssh config like this:
Host 127.0.0.1
Port 45
Host local
Port 40
HostName 127.0.0.1
User foo
What should rig do?
- query for
127.0.0.1in the config and discard anything found in there unless port is 40 and user is bob also in ssh config? - query for
127.0.0.1in the config and overwrite any rig settings with the ones from ssh config? - query for
127.0.0.1in the config and overwrite any ssh config values with what is in rig config? - query for
127.0.0.1in the config and error out if there's a mismatch between rig and ssh config? - query for all hosts, find one with HostName 127.0.0.1, user bob and port 40?
- introduce something like
ssh.hostand overwrite anything received with what is in rig config?
I think the best choice is number 3. It's pretty close to what command line ssh does without losing any ssh config functionality unless specifically using the host field in 6.
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity