Skip to content
Discussion options

You must be logged in to vote

I'm not sure why you'd want to disable sshd, but I don't know your environment. If you don't include the ssh cloud-init module, does it still enable sshd? For example, our main cloud.cfg file that ensures sshd is enabled contains:

cloud_init_modules:
 - bootcmd
 - growpart
 - migrator
 - resizefs
 - rsyslog
 - ssh                  # here
 - set_hostname
 - users-groups
 - update_hostname
 - update_etc_hosts
 - write-files

If that doesn't do the trick, is it possible that your image (before cloud-init gets to it) already has sshd enabled?

There might be a better way, but the brute-force approach could be something like this:

#cloud-config
runcmd:
    - [ systemctl, stop, openssh-server ]
…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by holmanb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants