Skip to content

ssh config generator, i.e, pulls aws tags > ~/.ssh/config

License

Notifications You must be signed in to change notification settings

thapakazi/easyssh-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

easyssh with tags

EasySSH revised

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

How to use it ?

docs on the way, hold your horses… or figure it out on your own ;)

Assumptions

  • 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"
        

Breakdown

Basic usage is like

   ./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

one more dependency

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`

About

ssh config generator, i.e, pulls aws tags > ~/.ssh/config

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages