cloud-init sample

    Openstack / / 2023. 7. 31. 20:39
    728x90

    CentOS Sample

    #cloud-config
    ssh_pwauth: True
    disable_root: false
    
    chpasswd:
      list: |
        root:test1234
      expire: False
    
    runcmd:
      - sed -i 's/#PermitRootLogin yes/PermitRootLogin yes/' /etc/ssh/sshd_config
      - sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
      - systemctl restart sshd
      - setenforce 0
      - sed -i 's/enforcing/disabled/g' /etc/selinux/config
      - systemctl disable firewalld
      - systemctl stop firewalld
      
    write_files:
      - path: /var/www/html/index.html
        content: |
          Hello Server.

     

    Ubuntu Sample

    #cloud-config
    ssh_pwauth: True
    chpasswd:
      list:
        - ubuntu:ubuntu!
      expire: False
    
    runcmd:
      - sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
      - sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
      - systemctl restart sshd
      - mkdir /test; touch /test/file1; touch /test/file2; cd /test 
      - nohup python3 -m http.server 80 &

     

    Ref : https://www.tencentcloud.com/ko/document/product/213/19670

     

    'Openstack' 카테고리의 다른 글

    kolla-ansible aio(all-in-one) install  (0) 2023.09.22
    kolla-ansible mariadb 백업/복구  (0) 2023.09.22
    ovs-dpdk port tcpdump  (0) 2023.01.04
    neutron openstack networking 정리  (0) 2022.03.26
    Linux Network Stack  (0) 2021.12.18
    • 네이버 블러그 공유하기
    • 네이버 밴드에 공유하기
    • 페이스북 공유하기
    • 카카오스토리 공유하기