-
Edit ssh config of your system
vim ~/.ssh/config
Paste the following content:
Host *
ServerAliveInterval 30
ServerAliveCountMax 5
TCPKeepAlive yes
Host bastion
HostName <bastion-ip>
User <username>
ForwardAgent yes
- Login to bastion and hop to to interested server
ssh bastion
ssh ubuntu@<'server-ip'> -i ~/.ssh/<private-key>
: Use team specific private key stored in
~/.ssh
directory on bastion server.
- To access database
ssh bastion
mysql --defaults-file=<cnf-file-path>
bastion ip: x.x.x.x
server-ip: x.x.x.x
private-key: ~/.ssh/team_key
Username: xxxx
cnf-file-path: ~/.xxx.cnf