# Set ssh authorized\_key without cloud-config? \[Raspberry Pi image\]

**URL:** <https://forums.suse.com/t/set-ssh-authorized-key-without-cloud-config-raspberry-pi-image/5091>\
**Category:** RancherOS\
**Created:** [January 4, 2017, 9:23pm UTC](https://forums.suse.com/t/set-ssh-authorized-key-without-cloud-config-raspberry-pi-image/5091 "2017-01-04T21:23:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dankeller](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/dankeller/32/2004_2.png) [@dankeller](https://forums.suse.com/u/dankeller)\
**Post date:** [January 4, 2017, 9:23pm UTC](https://forums.suse.com/t/set-ssh-authorized-key-without-cloud-config-raspberry-pi-image/5091/1 "2017-01-04T21:23:26Z")

</div>

According to the [official instructions](https://docs.rancher.com/os/running-rancheros/server/raspberry-pi/) for installing RancherOS on the RPi, it does not use cloud-config. I cannot find any info on setting the SSH authorized\_keys without using a cloud-config file. Anyone know how to do this? I’d like to not be stuck using the default password.

---

<div class="post-metadata">

**Author:** ![joshwget](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/joshwget/32/704_2.png) [@joshwget](https://forums.suse.com/u/joshwget)\
**Post date:** [January 4, 2017, 10:32pm UTC](https://forums.suse.com/t/set-ssh-authorized-key-without-cloud-config-raspberry-pi-image/5091/2 "2017-01-04T22:32:03Z")

</div>

A cloud-config file can’t be used on first boot since there’s no method to inject one like there is in other platforms. You can still add an SSH key with `ros config set` or `ros config merge` ([https://docs.rancher.com/os/configuration/](https://docs.rancher.com/os/configuration/)).

---

<div class="post-metadata">

**Author:** ![dankeller](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/dankeller/32/2004_2.png) [@dankeller](https://forums.suse.com/u/dankeller)\
**Post date:** [January 4, 2017, 10:42pm UTC](https://forums.suse.com/t/set-ssh-authorized-key-without-cloud-config-raspberry-pi-image/5091/3 "2017-01-04T22:42:45Z")

</div>

I tried that, but it seems I was not using the appropriate key. Not sure where I can get a list of all possible settings that `ros config` will recognize.

However, it seems I may have been overthinking it, since manually creating the `~/.ssh/authorized_keys` file seems to have done the trick.

---

<div class="post-metadata">

**Author:** ![macqb](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/macqb/32/2170_2.png) [@macqb](https://forums.suse.com/u/macqb)\
**Post date:** [February 24, 2017, 6:16pm UTC](https://forums.suse.com/t/set-ssh-authorized-key-without-cloud-config-raspberry-pi-image/5091/4 "2017-02-24T18:16:27Z")

</div>

so @joshwget could you give a bit of direction on what the merge command would look like?

I tried all manner of:

> sudo ros config merge rancher.ssh.keys.rsa(rsa-pub etc.) “ssh-rsa AAA…”

waited 30 mins in one instance until I quit the process as it seemed it was looking for further input from me.

I ended up doing as @dankeller did and also set the rancher login pass to return key to disable the plain rancher ssh login  
[my gist for rPi-Rancher ssh keys](http://ssh_to_rPi_on_RancherOS)

Thanks for any guidance  
d

---

<div class="post-metadata">

**Author:** ![stefanfoulis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/stefanfoulis/32/5212_2.png) [@stefanfoulis](https://forums.suse.com/u/stefanfoulis)\
**Post date:** [May 19, 2019, 3:28pm UTC](https://forums.suse.com/t/set-ssh-authorized-key-without-cloud-config-raspberry-pi-image/5091/5 "2019-05-19T15:28:20Z")

</div>

I’ve been able to set a ssh key with this command:

`sudo ros config set ssh_authorized_keys ['ssh-rsa XXXX']`  
and then rebooting.

However I’ve not figure out how to disable the default `rancher` password on the `rancher` user. I can still login with that over ssh ☹.

---

<div class="post-metadata">

**Author:** ![Jason-ZW](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/jason-zw/32/4607_2.png) [@Jason-ZW](https://forums.suse.com/u/Jason-ZW)\
**Post date:** [May 20, 2019, 8:21am UTC](https://forums.suse.com/t/set-ssh-authorized-key-without-cloud-config-raspberry-pi-image/5091/6 "2019-05-20T08:21:06Z")

</div>

@stefanfoulis

```auto
$ mkdir -p /boot
$ mount /dev/mmcblk0p1 /boot
$ vi /boot/cmdline.txt
#uncomment rancher.password=rancher
$ vi /etc/shadow
#change /etc/shadow rancher user to '!' e.g. rancher:!:17938:0:99999:7:::
$ reboot

```
