easy ssh to ec2 instance / hosts in ssh config file. now MacOS only.
brew install reiki4040/tap/rnssh
download rnssh binary file and set PATH
run rnssh -init
and save to rnssh config (~/.rnssh/config)
- set AWS credentials
- set AWS default region
- ssh config
- credential file (
~/.aws/credentials
)
[default]
aws_access_key_id=your_key_id
aws_secret_access_key=your_secret
- Environment variable (
~/.bashrc
,~/.bash_profile
, etc...)
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
run rnssh -init
and save to rnssh config (~/.rnssh/config)
vi ~/.ssh/config
Host X.X.X.X
HostName X.X.X.X
User your_user
IdentityFile you_key_file
ec2ssh helps your ssh configuration. it generate ssh config from EC2.
# set ssh config
rnssh
# not set ssh config
rnssh -i identity_file user@query_string
you can run rnssh
(without options -i
and user@) if you added instances to ssh config.
show ec2 instances list. you can filtering. if you specify query_string, already filtering instances.
Select ssh instance. You can do filtering>
instance name1 X.X.X.X
instance name2 X.X.X.Y
choose the instance, then start ssh to the instance!
rnssh does create cache the instances list automatically.
if you update instances, you must be reload with -f
option.
(launch, start, stop etc...)
without -f
, rnssh does load from cache file. it is faster than connect to AWS(with -f
).
rnssh can filter instances with using arguments
rnssh web server
already filtered and it is able to modify if you want.
QUERY>web server
web server1 X.X.X.X
web server2 Y.Y.Y.Y
if you delete character, then show other name instances again.
if you always rnssh with -p
(Private IP) or -n
(Name Tag), you can edit default with rnssh -init
host type's valid values are below.
public
(default)private
(for VPN/Bastion)name
(need ssh config)
and you can use -P
-p
-n
, when you want to use other ssh host type temporarily.
if you want to use other temporarily, then you can use -use-ssh-config
and -use-ec2
option.
update & upgrade
brew update
brew upgrade rnssh
please replace to new binary.
- Test code
Copyright (c) 2015- reiki4040
MIT LICENSE