Refresher to build a more-friendly ssh generator. Most of the code is seamlessly copied from my old repo
Changelog:
- v2: revised with more better options, verbosity and independed pkg
- v1: simple POC version of easy ssh
docs on the way, hold your horses… or figure it out on your own ;)
- aws configs{keys, regions} are exported well
- you will help me clean/review it someday in future
export AWS_ACCESS_KEY=my_aws_keys export AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY}" export AWS_SECRET_KEY=my_dirty_secrets export AWS_SECRET_ACCESS_KEY="${AWS_SECRET_KEY}" #region export EC2_REGION="my_regions-1" export AWS_REGION="${EC2_REGION}" export EC2_URL="http://ec2.${EC2_REGION}.amazonaws.com"
./easyssh -h
Usage of ./easyssh:
-end_msg="##END OF GENERATED SSH CONFIG##": custom comment end msg
-port="22": ssh port to knock
-start_msg="##START OF GENERATED SSH CONFIG##": custom comment msg at start of generated ssh config
-username="ubuntu": ssh username to login as
where,
- -end_msg & -start_msg : custom msg to put at start and end of generated config, useful if you have multiple configs
- -username & -port : self explainator; custom username and port
For seamless ssh, bastion is used and the trick is:
Host !my_bastion_host* ProxyCommand ssh -W %h:%p my_bastion_host User ubuntu Port 22 ForwardAgent yes
where,
- my_bastion_host* : my bastion host i use to ssh to vpc instances
So put/modify somewhere in your `~/.ssh/config`