4.3. cloud-init でのデフォルトユーザー名の変更
デフォルトのユーザー名は、cloud-user 以外のものに変更できます。
手順
データソースの要件に応じて、
user-dataファイルを編集するか、以下のディレクティブをcloud.cfg.dディレクトリーに追加します。注記cloud-initが、ユーザーディレクティブを含むファイルを認識できるように、すべてのユーザーディレクティブはファイルの最上部に#cloud-configが含まれます。cloud.cfg.dディレクトリーにディレクティブを含める場合は、ファイル名を*.cfgとし、ファイルの最上部に常に#cloud-configを含めます。user: <username> の行を追加します。<username> は新しいデフォルトのユーザー名に置き換えます。#cloud-config user: username password: mypassword chpasswd: {expire: False} ssh_pwauth: True ssh_authorized_keys: - ssh-rsa AAA...SDvz user1@yourdomain.com - ssh-rsa AAB...QTuo user2@yourdomain.com