Skip to content

Instantly share code, notes, and snippets.

@sahilsk
Last active August 11, 2016 09:32
Show Gist options
  • Save sahilsk/23fe343ecb6af3d879e6 to your computer and use it in GitHub Desktop.
Save sahilsk/23fe343ecb6af3d879e6 to your computer and use it in GitHub Desktop.
Instructions to login to servers. Tags: ssh config, jump host, bastion

How to access server

  • 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>
@sahilsk
Copy link
Author

sahilsk commented Mar 14, 2016

bastion ip: x.x.x.x
server-ip: x.x.x.x
private-key: ~/.ssh/team_key
Username: xxxx
cnf-file-path: ~/.xxx.cnf

NOTE: Only accessible from VPN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment