启动 EC2 实例时,用户数据脚本不起作用

启动 EC2 实例时,用户数据脚本不起作用

全部,

我有如下的用户数据脚本。

Content-Type: multipart/mixed; boundary="==BOUNDARY=="
MIME-Version: 1.0
--==BOUNDARY==
MIME-Version: 1.0
Content-Type: text/cloud-config; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="cloud_config_data"

#cloud-config
users:
- name: insight
  ssh_authorized_keys:
  - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDgOhHW7poiNcQmn9P+SfJ7Vt92OI9PrOqaMa3/E2YHhjvPPE4TyFjvCZnjve0CFvwSKXLjIcNJZFY2jNboFsrjlIJgpe6ahGi0kaz8e2zqXyZYOpdKdqpoT47Jzt2L2PSlYow1iBALYXmwzmespWyaUJRzA2wemZu2f9Fxm5YS4D1JOkvl24Ro+uikU/bZk3gFJL4wUjc5g8h7Yavx2ps/mNO88BGutSKiqrlKFjErTAM+bzCFjHr6c7G6H1siHf4CP30i1cE3If+QkbKgdop2kPpd/j3E/4W/PITroHcvtmJ/R25grOS176PvaiPDQmpeHdZJw6RuYbW0Wq84Vq4N [email protected]
- name: oracle
  ssh_authorized_keys:
  - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDgOhHW7poiNcQmn9P+SfJ7Vt92OI9PrOqaMa3/E2YHhjvPPE4TyFjvCZnjve0CFvwSKXLjIcNJZFY2jNboFsrjlIJgpe6ahGi0kaz8e2zqXyZYOpdKdqpoT47Jzt2L2PSlYow1iBALYXmwzmespWyaUJRzA2wemZu2f9Fxm5YS4D1JOkvl24Ro+uikU/bZk3gFJL4wUjc5g8h7Yavx2ps/mNO88BGutSKiqrlKFjErTAM+bzCFjHr6c7G6H1siHf4CP30i1cE3If+QkbKgdop2kPpd/j3E/4W/PITroHcvtmJ/R25grOS176PvaiPDQmpeHdZJw6RuYbW0Wq84Vq4N [email protected]
- name: admin
  ssh_authorized_keys:
  - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDgOhHW7poiNcQmn9P+SfJ7Vt92OI9PrOqaMa3/E2YHhjvPPE4TyFjvCZnjve0CFvwSKXLjIcNJZFY2jNboFsrjlIJgpe6ahGi0kaz8e2zqXyZYOpdKdqpoT47Jzt2L2PSlYow1iBALYXmwzmespWyaUJRzA2wemZu2f9Fxm5YS4D1JOkvl24Ro+uikU/bZk3gFJL4wUjc5g8h7Yavx2ps/mNO88BGutSKiqrlKFjErTAM+bzCFjHr6c7G6H1siHf4CP30i1cE3If+QkbKgdop2kPpd/j3E/4W/PITroHcvtmJ/R25grOS176PvaiPDQmpeHdZJw6RuYbW0Wq84Vq4N [email protected]
runcmd:                                                                                                                                                                   - usermod -p '$6$lNYaFbXldWh3c0Rv$qasHT06upnZTbK9dsrhtPmw1fIWgcdda/jX4N2NCTjyU4RRCowcvavoItgFhc5Q7BdtVd1Chv7BoQY7Wo.hDP.' admin
  - pam_tally2 --user=admin --reset
                                                                                                                                                                        --==BOUNDARY==                                                                                                                                                          MIME-Version: 1.0                                                                                                                                                       Content-Type: text/text; charset="us-ascii"                                                                                                                             Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="placeholder.txt"                                                                                                             {                                                                                                                                                                         "InstanceName": "test001-ems",                                                                                                                                          "NtpServer": "10.1.1.6",                                                                                                                                                "DnsServer": "10.2.1.2"                                                                                                                                               }                                                                                                                                                                       --==BOUNDARY==    

有人能告诉我脚本中可能出了什么问题吗?我想以 admin 作为用户名登录实例,但在执行用户数据脚本后,这对我来说不起作用。

相关内容