shuttle
shuttle copied to clipboard
Add more ssh_config directives
Requested by @skebi69 Add more flexibility with building the JSON settings for Hosts parsed in ssh_config
Example:
Host gandalf
# shuttle.name = work/servers/web01 (webserver)
# shuttle.cmd = ssh -Nf webserver
# shuttle.theme = Homebrew
# shuttle.title = personal webserver
# shuttle.window = new
HostName [email protected]
Instead of the following in AppDelegate.m:
// if everything worked out we will see a non-nil itemList where the
// system should be appended to. part hold the last part of the splitted string (aka hostname).
if (itemList) {
// build the corresponding ssh command
NSString* cmd = [NSString stringWithFormat:@"ssh %@", key];
we change it to:
// if everything worked out we will see a non-nil itemList where the
// system should be appended to. part hold the last part of the splitted string (aka hostname).
if (itemList) {
// build the corresponding ssh command
NSString* cmd = servers[key][@"cmd"] ?
cmd = servers[key][@"cmd"] : [NSString stringWithFormat:@"ssh %@", key];
The reason we do this is to enable snippets like this in ~/.ssh/config:
Host Sandbox-Tunnels
shuttle.name = Sandbox/_Tunnels
shuttle.cmd = ssh -Nf Sandbox-Tunnels && exit
Hostname A.B.C.D Port 57534 LocalForward 127.0.0.1:12345 some.machine.us-east-1.rds.amazonaws.com:1521 LocalForward 127.0.0.1:12356 10.100.9.10:22 LocalForward 127.0.0.1:12357 10.100.1.100:22
The # shuttle.cmd directive allows us to establish a non-interactive session with the bastion host (using –Nf and exit). This allows users to establish “tunnels” and then use those tunnels to connect to servers secured behind the bastion host.
@skebi69 Looks reasonable! If you want to make a pull request I'll test it out to make sure we have no regressions. If all tests well I'll commit it.
I can't create a branch (shuttle-johnk) to push the change to. Permission denied.
Click on the Pull Request button; where it says this branch is 1 commit ahead.