Enable ssh over proxy command
This commit is contained in:
@@ -207,6 +207,13 @@ ssh:
|
|||||||
proxy: "app@192.168.0.1"
|
proxy: "app@192.168.0.1"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Also if you need specific proxy command to connect to the server:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
ssh:
|
||||||
|
proxy_command: aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p' --region=us-east-1 ## ssh via aws ssm
|
||||||
|
```
|
||||||
|
|
||||||
### Using env variables
|
### Using env variables
|
||||||
|
|
||||||
You can inject env variables into the app containers using `env`:
|
You can inject env variables into the app containers using `env`:
|
||||||
|
|||||||
@@ -143,6 +143,8 @@ class Mrsk::Configuration
|
|||||||
if raw_config.ssh.present? && raw_config.ssh["proxy"]
|
if raw_config.ssh.present? && raw_config.ssh["proxy"]
|
||||||
Net::SSH::Proxy::Jump.new \
|
Net::SSH::Proxy::Jump.new \
|
||||||
raw_config.ssh["proxy"].include?("@") ? raw_config.ssh["proxy"] : "root@#{raw_config.ssh["proxy"]}"
|
raw_config.ssh["proxy"].include?("@") ? raw_config.ssh["proxy"] : "root@#{raw_config.ssh["proxy"]}"
|
||||||
|
elsif raw_config.ssh.present? && raw_config.ssh["proxy_command"]
|
||||||
|
Net::SSH::Proxy::Command.new(raw_config.ssh["proxy_command"])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user