If you are running your servers in different VPC than based on the cidr range of the ip addresses and different username its difficult to remember all the keys and username while connecting to the servers.
You can use an ssh config file to overcome this issue
Add the content below to the file ~/.ssh/config :
You can use an ssh config file to overcome this issue
Add the content below to the file ~/.ssh/config :
Host 10.0.6.* hostname* userIdentityFile ~/ /.ssh/id_rsa ProxyCommand ssh < firstname_employeeid>@54.254.*.*(public ip) nc %h %p ForwardAgent yes Host hostname* 10.252.*.* ForwardAgent yes user IdentityFile ~/< your laptop user >/.ssh/id_rsa ProxyCommand ssh @52.72.*.*(public ip) nc %h %p
Please fill your own usernames in the <> items above and public ip of your bastion host to connect to the server.
0 comments:
Post a Comment