Login to AMI with the "connect" User ID - aws_mainframe_modernization_service - Latest

AWS Mainframe Modernization Data Replication for IBM z/OS

Product type
Software
Portfolio
Integrate
Product family
Connect
Product
AWS Mainframe Modernization > AWS Mainframe Modernization Service
Version
Latest
ft:locale
en-US
Product name
AWS Mainframe Modernization
ft:title
AWS Mainframe Modernization Data Replication for IBM z/OS
Copyright
2025
First publish date
2000
ft:lastEdition
2025-02-10
ft:lastPublication
2025-02-10T15:55:15.122000

Upon the initial launch of the AMI, you have the option to access it using the "connect" user ID through two different methods. Here is a detailed guide on how to use each method:

Option 1: Indirect Login via "ec2-user" (available immediately after launch)

  1. Identify your AMI host
    Use the command below to assign your AMI public name to a variable:
    remoteUser> export AWS_AMI_HOST=ec2-44-199-189-148.compute-1.amazonaws.com
  2. Connect to the "ec2-user"
    Use the following command to SSH into the "ec2-user" account using its PEM file:
    remoteUser> ssh -i ami-ec2-user.pem ec2-user@$AWS_AMI_HOST
  3. Switch to the "connect" User
    Once logged in, use the command below to switch to the "connect" user:
    ec2-user> sudo su – connect

Option 2: Direct login as "connect" User (setup required)

  1. Generate an SSH key pair (skip if you already have one)
    On your local machine, generate an SSH key pair using the following command:
    ssh-keygen -t rsa -b 2048
  2. Transfer the public key to the EC2 instance
    1. Copy the public key (id_rsa.pub) content. You can view the content using:
      cat ~/.ssh/id_rsa.pub

      Now, log in to your EC2 instance with your PEM key as usual and execute the following commands to add the public key to the "connect" user's authorized keys:

    2. Switch to the "connect" user:
      sudo su - connect
    3. Create a .ssh directory (if it does not exist) and navigate to it:
      mkdir -p ~/.ssh
      cd ~/.ssh
    4. Edit or create the authorized_keys file and add the content of id_rsa.pub to it. You can use a text editor like vi to do this:
      vi authorized_keys
    5. Paste the content of id_rsa.pub into this file, save, and exit the editor.
  3. Adjust permissions on the .ssh directory and authorized_keys file
    To secure the SSH setup, set the appropriate permissions on the .ssh directory and authorized_keys file:
    chmod 700 ~/.ssh
    chmod 600 ~/.ssh/authorized_keys
  4. Login directly as the "connect" User
    Now, from your local machine, you can log in directly as the "connect" user using the private key (id_rsa) you generated earlier:
    ssh -i ~/.ssh/id_rsa connect@ec2-44-199-189-148.compute-1.amazonaws.com

    This setup maintains a high level of security as it relies on SSH key authentication rather than passwords.