Skip to content

Instantly share code, notes, and snippets.

@shukla2112
Forked from sahilsk/Instructions_to_login.md
Last active April 28, 2020 02:36
Show Gist options
  • Save shukla2112/b3174857b5bcaeabd7eea71c16fdf649 to your computer and use it in GitHub Desktop.
Save shukla2112/b3174857b5bcaeabd7eea71c16fdf649 to your computer and use it in GitHub Desktop.
Instructions to login to servers

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

    example - ssh ubuntu@<'server-ip'> -i ~/.ssh/fabric_team
  • To access database
    ssh bastion
    mysql --defaults-file=<cnf-file-path>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment