Skip to content

Instantly share code, notes, and snippets.

@asvignesh
Created January 6, 2018 07:42
Show Gist options
  • Save asvignesh/50a8c389bbeb549da8cf62f266f3daf2 to your computer and use it in GitHub Desktop.
Save asvignesh/50a8c389bbeb549da8cf62f266f3daf2 to your computer and use it in GitHub Desktop.

Revisions

  1. asvignesh created this gist Jan 6, 2018.
    1 change: 1 addition & 0 deletions Build_seed_iso
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    $ genisoimage -output seed.iso -volid cidata -joliet -rock user-data meta-data
    10 changes: 10 additions & 0 deletions meta-data
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    local-hostname: asvignesh.local
    # eth0 is the default network interface enabled in the image. You can
    # configure static network settings with an entry like below.
    #network-interfaces: |
    # iface eth0 inet static
    # address 192.168.1.10
    # network 192.168.1.0
    # netmask 255.255.255.0
    # broadcast 192.168.1.255
    # gateway 192.168.1.254
    27 changes: 27 additions & 0 deletions user-data
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    #cloud-config
    # vim:syntax=yaml
    users:
    # A user by the name ec2-user is created in the image by default.
    - default
    # Following entry create user1 and assigns password specified in plain text.
    # Please not use of 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 here >
    lock_passwd: false
    # Following entry creates user2 and attaches a hashed passwd to the user. Hashed
    # passwords can be generated with:
    # python -c 'import crypt,getpass; print crypt.crypt(getpass.getpass())'
    - name: user2
    passwd: < hashed password here >
    lock_passwd: false
    # Following entry creates user3, disables password based login and enables an SSH public key
    - name: user3
    ssh-authorized-keys:
    - < ssh public key here >
    lock_passwd: true
    chpasswd:
    list: |
    ec2-user:< plain text password here >