How do i use amazon linux 2 for as an on-premise operating system?



  • It's cloud in'it!

    Link: https://aws.amazon.com/about-aws/whats-new/2017/12/introducing-amazon-linux-2/

    AWS link to create a on-premise installation: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/amazon-linux-2-virtual-machine.html

    Amazon Linux 2 is a the second gen Amazon Linux distribution. It also makes it easy to install on-premise as well as cloud. Later using Amazon Linux 2 on the cloud you can expect to have predictable results. There are a lot of benefits for using it, it's aligned for using with the AWS Cloud. Companies need to evaluate what they need.

    For demo/test purposes
    First create a file called meta-data and put the following contents into it.

    local-hostname: amazonlinux.onprem
    

    Create another file called user-data, replacing the passwords.

    #cloud-config
    # vim:syntax=yaml
    users:
    # A user by the name ec2-user is created in the image by default.
      - default
    # The following entry creates user1 and assigns a plain text password.
    # Please note that the use of a plain text password is not recommended from security best practises standpoint.
      - name: user1
        groups: sudo
        sudo: ['ALL=(ALL) NOPASSWD:ALL']
        plain_text_passwd: plain-text-password
        lock_passwd: false
    # The following entry creates user2 and attaches a hashed password to the user. Hashed passwords can be generated with:
    # python -c 'import crypt,getpass; print crypt.crypt(getpass.getpass())'
      - name: user2
        passwd: hashed-password
        lock_passwd: false
    # The following entry creates user3, disables password-based login and enables an SSH public key.
      - name: user3
        ssh-authorized-keys:
                - ssh-public-key-information
        lock_passwd: true
    
    chpasswd:
      list: |
        ec2-user:plain-text-password
    # In the above line, do not add any spaces after 'ec2-user:'.
    

    Create a iso image to attach as a virtual cdrom to the bootstrap process.

    $ genisoimage -output myamzlinux.iso -volid cidata -joliet -rock user-data meta-data
    

    Attaching the myamzlinux.iso as a cd-rom virtual device will configure the settings. This is a basic user-data configuration, all the option for cloud-init can be found at: https://cloud-init.io


Log in to reply
 

© Lightnetics 2024