Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ssh config files (defined by a parameter) #2233

Open
ludwig-gramberg opened this issue Jun 22, 2017 · 0 comments
Open

Support ssh config files (defined by a parameter) #2233

ludwig-gramberg opened this issue Jun 22, 2017 · 0 comments

Comments

@ludwig-gramberg
Copy link

When having multiple projects with multiple sets of ssh-keys and ssh_config files (one for each project) it is very important to be able to define a ssh_config file by parameter.

The (outstanding) example here being ansible: I can define a ssh_config file in my ansible.cfg and now the key, the known_hosts etc. is all defined.

Why this is important: I'm accessing many servers/containers through a vpn or bastion hosts. So for my local machine I need to separate ssh-contexts by project otherwise ip-ranges (10.11.0.x) would overlap.

Example of ssh_config:

UserKnownHostsFile = ./.ssh/known_hosts
ServerAliveInterval 15
ConnectTimeout 30
UseRoaming no
IdentitiesOnly yes

Host *
  ControlMaster auto
  ControlPath ./.ssh/cm_socket_%r@%h:%p
  ControlPersist 30m

Host 33.33.33.33 myhost.domain.suffix
  HostName 33.33.33.33
  IdentityFile ./.ssh/keys/%r_ed25519

Host 10.11.0.10 container-a
  HostName 10.11.0.10
  IdentityFile ./.ssh/keys/%r_ed25519
  ProxyCommand ssh -F ./ssh.cfg -W %h:%p %[email protected]

Host 10.11.0.11 container-b
  HostName 10.11.0.11
  IdentityFile ./.ssh/keys/%r_ed25519
  ProxyCommand ssh -F ./ssh.cfg -W %h:%p %[email protected]

# (ips are just examples)

a command is then run locally as such:

ssh -F ssh.cfg someuser@container-a or ssh -F ss.cfg [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants