How to Forward SSH Connections

Meet Jane. From time to time, she works from home. She needs to connect to her Linux machine in the office. From time to time, she connects from home to his office Linux box and from there to the Jenkins CI server provisioned in the company’s development AWS cloud environment.

Configure SSH

Let’s have a look at her ssh config file:

  • HostName – Jenkins host in the AWS Management VPC
  • <your office machine IP> – IP address of the office machine
  • joe – user name
  • id_rsa_corp_mac – prv ssh key that allows to connect from the laptop to the office machine
  • ec2-user – default user of the AWS host (Jenkins)
  • 7777 – port we can access Jenkins UI on the laptop
  • 8080 – Jenkins port
  • id_rsa_v8 – prv ssh key on the laptop (the key allows to ssh to the Jenkins host)

Given all names and paths in the config file are correct, Jane is ready to ssh to the Jenkins machine. What is also important, Jane will be able to access Jenkins Web UI.

SSH to the Jenkins Machine

Jane opens a terminal and types:

and voila! She successfully connects to the EC2 instance running the Jenkins server.

The next step for Jane is to access Jenkins WebUI from a web browser from her laptop. Jane opens the web browser and types url:

Congratulations! Job done. Jane can start configuring build jobs.

References:

Leave a reply:

This site uses Akismet to reduce spam. Learn how your comment data is processed.