Question

cloud-config on cents not working (at all)

  • Posted on January 5, 2015
  • frankisAsked by frankis

I am trying to create a new CentOS7 (in AMS2) droplet with the following User-Data. Unfortunately none of the provided User-Data are applied.

Please advise.

#cloud-config

users:
  - name: someuser
    groups: wheel
    sudo: ['ALL=(ALL) NOPASSWD:ALL']
    shell: /bin/bash
    ssh-authorized-keys:
      - ssh-dss 
AAAABBBBCCCCDDDD...

runcmd:
  - sed -i -e '/^PermitRootLogin/s/^.*$/PermitRootLogin yes/' /etc/ssh/sshd_config
  - sed -i -e '$aAllowUsers someuser' /etc/ssh/sshd_config
  - service sshd restart

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

I’m not really using it on DO, but on AWS and I had the same issue. Turns out that SELinux was preventing cloud-init from creating /etc/passwd+ which caused this to fail. You can check whether this is your problem by 1) running getenforce and 2) checking /var/log/audit/audit.log

Cheers, Luiz

Bump. Any easy/known fix for this?

After a recent reboot, I find nothing logging to syslog, messages, secure. They were written to at the time of boot, but not since (now 3 days later). btmp, wtmp, and lastlog are updating, other apps logging outside of /var/log are writing still.

How do you fix the problem?