XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Custom config / cloud-init

    Scheduled Pinned Locked Moved Management
    2 Posts 1 Posters 17 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Offline
      acebmxer
      last edited by acebmxer

      So i am trying to learn how to use the Custom config / cloud-init for ubuntu.

      If I add my ssh-key to my user account in Xen orchestra (XOA or XO-CE) I can select that during the vm creation and that works but the VM is stuck with the username ubuntu. I would to change that.

      I am not sure if I am messing up the user creation or the ssh-key as i am not able to log in do to authentication error.

      My config ---

      #cloud-config
      hostname: {name}
      users:
        - newusername
      ssh_authorized_keys:
            - ssh-rsa AAAAB3NzaC1.....XbZH6muQrfegKoTsuw== Generated By Termius
      

      The above is not my actual key. In the key saved in user profile stops before the"==" and as stated that key works. So i assume if I correct the config to remove the "==" and after that key should work as well. So my assumption is the user name is the issue.

      I would like to make the username to my desire but have the same permission as the user account ubuntu has when just inserting ssh-key.

      A 1 Reply Last reply Reply Quote 0
      • A Offline
        acebmxer @acebmxer
        last edited by

        Think I figured it out. first i was using the wrong key. A lot of going back and forth trying new keys forgot to swap back to original...

        new config...

        #cloud-config
        hostname: {name}
        users:
          - name: newusername
            gecos: New User
            sudo: ALL=(ALL) NOPASSWD:ALL
            groups: users, admin
            shell: /bin/bash
            ssh_authorized_keys:
              - ssh-ed25519 AAAAC3....18ZbA
        

        Any suggestions should I not use something in the above config if the server was in production?

        1 Reply Last reply Reply Quote 1
        • First post
          Last post