Results 1 to 1 of 1

Thread: Autoinstall cloud-init wount run Late-comandows

  1. #1
    Join Date
    Apr 2017
    Beans
    2

    Autoinstall cloud-init wount run Late-comandows

    Using Ubuntu Server 22.04, I am attempting to create an auto-installation setup for a physical client. I want to enable root login and execute late commands. Additionally, I want the hostname to be set as "new-client-macadress" without colons. Despite trying various syntaxes, the commands do not seem to take effect. I have experimented with different configurations, but none have yielded the desired results.

    Here is my cloud-init conf
    [QUOTE][
    #cloud-config
    autoinstall:
    version: 1
    user-data:
    hostname: new-client
    timezone: Europe/Stockholm
    chpasswd:
    expire: false
    list:
    - root:$6$exDY1mhS4KUYCE/2$zmn9ToZwTKLhCw.b4/b.ZRTIZM30JZ4QrOQ2aOXJ8yk96xpcCof0kxKwuX1kqLG/ygbJ1f8wxED22bTL4F46P0
    keyboard:
    layout: se
    toggle: null
    variant: ''

    late-commands:
    - sed -i "s?new-client?new-client-$(cat /target/sys/class/net/enp*/address | sed 's/\://g')?g" /target/etc/hostname /etc/hosts"
    - echo "PermitRootLogin yes" | tee -a /target/etc/ssh/sshd_config"
    - systemctl restart ssh
    /QUOTE]
    Very grateful for any feedback
    Last edited by eura; 4 Weeks Ago at 11:35 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •