cancel
Showing results for 
Search instead for 
Did you mean: 
tnishiok
Flight Engineer
Flight Engineer
  • 486 Views

Tips: SSH Login to Labs for CUI Preference

Hi colleagues,

This pertains to the recent conversation initiated by @crixus1 about "Redhat Learning Labs". It led me to question if anyone else prefers using SSH login from their local PC to the Lab, merely favoring CLI over the Web GUI rather than due to the corporate firewall restrictions or policies as mentioned by @crixus1. I personally utilize SSH remote port forwarding for this purpose since CLI is faster than GUI, and I am sharing the method below:

Prerequisites

  • Initial Access to the Lab via Web GUI is yet necessary to establish an SSH tunnel.

  • An SSH server is operational on your local PC.

  • Your local PC has a global IP address to receive incoming SSH requests.
    • If this is not the case, a cloud computing resource like AWS EC2 can be used. It's possible to establish an EC2 instance with a global IP address to serve as an SSH bastion server, and this can be done within the free tier at no cost.

Steps

  1. As usual, start the Redhat Lab and log in to the workstation via Web GUI.

  2. From the workstation, set up an SSH connection to your local PC with remote port forwarding:

    [student@workstation ~] $ ssh -R 2222:localhost:22 your-user-id@your-local-host

    This session shall be kept connected until you finish Lab excersise.
     
  3. Open terminal on your local PC (Not via the Web GUI), and do SSH login to the Lab via the established SSH tunnel port. After this you don't need to use the Web GUI.

    Example: RH294 Lab

    [your-user-id@your-local-host ~] $ ssh -p 2222 student@localhost

    student@localhost's password:

    [student@workstation ~] $ hostname
    workstation.lab.example.com
    [student@workstation ~]$ getent hosts server{a..d}
    172.25.250.10 servera.lab.example.com
    172.25.250.11 serverb.lab.example.com
    172.25.250.12 serverc.lab.example.com
    172.25.250.13 serverd.lab.example.com

     

Labels (2)
1 Reply
tnishiok
Flight Engineer
Flight Engineer
  • 482 Views

Since this approache still requires the initial setup via Web GUI, it cannot address the use case of @crixus1. Neverthless it proves particulary beneficial for courses that require extensive amount of typing like the Ansible course, given that the response of SSH CLI is typically faster than Web GUI. It also makes copying and pasting from and into the Lab environment considerably easier.

Since this thread is not about question I don't expect answer. But it would be great if anybody can share your BKM.

Regards,
Toshi

Join the discussion
You must log in to join this conversation.