← Back to Index | ← Previous: Day 6

Objective

The system admins team of xFusionCorp Industries has set up some scripts on jump host that run on regular intervals and perform operations on all app servers in Stratos Datacenter. To make these scripts work properly we need to make sure the thor user on jump host has password-less SSH access to all app servers through their respective sudo users (i.e tony for app server 1). Based on the requirements, perform the following:

  1. Set up a password-less authentication from user thor on jump host to all app servers through their respective sudo users.
Steps
  1. Generate SSH Key Pair for thor on jump-host
    ssh-keygen -t rsa -b 2048 -f ~/.ssh/id_rsa -N ""
    # -N "" means no passphrase (required for password-less auth)
  2. Copy SSH Public Key to Each App Server Use ssh-copy-id with each server’s sudo user. You’ll be prompted for the user’s password once:
    ssh-copy-id tony@stapp01
    ssh-copy-id steve@stapp02
    ssh-copy-id banner@stapp03
  3. Verify Password-less SSH Works
    ssh tony@stapp01 "echo 'App1 OK' && hostname"