# Restart SSH service in cloud-config

**URL:** <https://forums.suse.com/t/restart-ssh-service-in-cloud-config/14077>\
**Category:** RancherOS\
**Created:** [April 25, 2019, 6:00am UTC](https://forums.suse.com/t/restart-ssh-service-in-cloud-config/14077 "2019-04-25T06:00:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmgilman](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/jmgilman/32/5115_2.png) [@jmgilman](https://forums.suse.com/u/jmgilman)\
**Post date:** [April 25, 2019, 6:00am UTC](https://forums.suse.com/t/restart-ssh-service-in-cloud-config/14077/1 "2019-04-25T06:00:08Z")

</div>

Hi all,

I’m writing the /etc/ssh/sshd\_config file via cloud-config. Specifically, I’m setting some trusted CA keys to allow SSH via signed certificates. I’ve had no issue getting the file modified, however I noticed that after RancherOS boots, the changes in /etc/ssh/sshd\_config are not implemented until I login and manually do a:

> system-docker restart console

So I tried adding that into a run command in my cloud-config:

> runcmd:
> 
> - system-docker restart console

However, when I boot with the cloud-config RancherOS loads all the way up until it’s about to launch the console and then freezes.

Is there another way I can restart the SSH daemon to ensure my changes are reflected when it boots up?

---

<div class="post-metadata">

**Author:** ![kfbfarley](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/kfbfarley/32/9119_2.png) [@kfbfarley](https://forums.suse.com/u/kfbfarley)\
**Post date:** [June 19, 2022, 11:37am UTC](https://forums.suse.com/t/restart-ssh-service-in-cloud-config/14077/3 "2022-06-19T11:37:55Z")

</div>

trying to find the same solution, maybe you have to rebuild rancher os image doing the following:

```auto
#cloud-config
ssh_authorized_keys:
    - ssh-rsa YOUR_HASH rancher
hostname: gil
write_files:
    - path: /etc/ssh/sshd_config
      owner: root
      permissions: '0600'
      content: |
          PermitRootLogin yes
          PasswordAuthentication yes

```

This worked perfectly well.
