# Failed to install due to not found /root/authorized\_keys file

**URL:** https://meta.discourse.org/t/failed-to-install-due-to-not-found-root-authorized-keys-file/38873
**Category:** Self-hosting
**Created:** [2016年二月2日 04:24 UTC](https://meta.discourse.org/t/failed-to-install-due-to-not-found-root-authorized-keys-file/38873 "2016-02-02T04:24:23Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![javenfang](https://avatars.discourse-cdn.com/v4/letter/j/df705f/32.png) [@javenfang](https://meta.discourse.org/u/javenfang)
#### Post date: [2016年二月2日 04:24 UTC](https://meta.discourse.org/t/failed-to-install-due-to-not-found-root-authorized-keys-file/38873/1 "2016-02-02T04:24:23Z")

</div>

I’ve tried many many times and different env, and try to search to resolve the problem. But I failed.

With installation from official doc, I always fail into the error reported:

```
I, [2016-02-02T03:25:19.047866 #38] INFO -- : > echo "Beginning of custom commands"
I, [2016-02-02T03:25:19.052456 #38] INFO -- : Beginning of custom commands

I, [2016-02-02T03:25:19.053237 #38] INFO -- : > echo "End of custom commands"
I, [2016-02-02T03:25:19.055437 #38] INFO -- : End of custom commands

I, [2016-02-02T03:25:19.055904 #38] INFO -- : > awk -F\# '{print $1;}' ~/.ssh/authorized_keys | awk 'BEGIN { print "Authorized SSH keys for this container:"; } NF>=2 {print $NF;}'
awk: fatal: cannot open file `/root/.ssh/authorized_keys' for reading (No such file or directory)
I, [2016-02-02T03:25:19.060638 #38] INFO -- : Authorized SSH keys for this container:

I, [2016-02-02T03:25:19.061065 #38] INFO -- : Terminating async processes

```

I tried env:

- centos 7.2, root or non-root user;
- ubuntu 14.04, root or non-root user;

---

<div class="post-metadata">

### Author: ![Sander78](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sander78/32/296615_2.png) [@Sander78](https://meta.discourse.org/u/Sander78)
#### Post date: [2016年二月2日 09:22 UTC](https://meta.discourse.org/t/failed-to-install-due-to-not-found-root-authorized-keys-file/38873/2 "2016-02-02T09:22:32Z")

</div>

Double check: are you using [the official Docker install](https://github.com/discourse/discourse/blob/master/docs/INSTALL.md)?

---

<div class="post-metadata">

### Author: ![javenfang](https://avatars.discourse-cdn.com/v4/letter/j/df705f/32.png) [@javenfang](https://meta.discourse.org/u/javenfang)
#### Post date: [2016年二月2日 13:13 UTC](https://meta.discourse.org/t/failed-to-install-due-to-not-found-root-authorized-keys-file/38873/3 "2016-02-02T13:13:12Z")

</div>

Yes, I am using the official guide: [discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md)

---

<div class="post-metadata">

### Author: ![Werner\_M](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/werner_m/32/121993_2.png) [@Werner\_M](https://meta.discourse.org/u/Werner_M)
#### Post date: [2016年二月3日 01:46 UTC](https://meta.discourse.org/t/failed-to-install-due-to-not-found-root-authorized-keys-file/38873/4 "2016-02-03T01:46:03Z")

</div>

I’m running into the same issue.  
I’ve set up an AWS EC2 running Ubuntu Trusty. Installed Docker following all the procedures described [here](https://docs.docker.com/engine/installation/ubuntulinux/) (including all pre-requisites), everything checks fine and Docker started up cleanly.

Installed Discourse following the procedures outlined [here](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md). Configured the variables in /var/discourse/containers/app.yml file according to instructions and my current environment – btw, I know these settings are correct because I had previously installed Discourse in another Ubuntu Trusty server running Apache hosting a development website I use in a regular basis for debugging (the reason for moving Discourse to an EC2 instance is because I couldn’t get both the Apache Server and Docker running concurrently in the Ubuntu server).

So after doing all this, and upon running  
` ./launcher bootstrap app`

near the end of the bootstrap process I get that same error. Anyone with ideas on how to get past that and get Discourse running?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2016年二月3日 02:18 UTC](https://meta.discourse.org/t/failed-to-install-due-to-not-found-root-authorized-keys-file/38873/5 "2016-02-03T02:18:11Z")

</div>

Use Ubuntu 14.04 x64 LTS instead. That is what we recommend.

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [2016年二月3日 07:21 UTC](https://meta.discourse.org/t/failed-to-install-due-to-not-found-root-authorized-keys-file/38873/6 "2016-02-03T07:21:21Z")

</div>

What file in `samples` did you copy into `containers/app.yml`? What changes did you make? Can you post the complete `app.yml` file here in the topic, so we can try to reproduce the problem?

It’s the `authorized_keys` _in the container_ which isn’t being found. Normally, the `sshd.template.yml` file is where `authorized_keys` gets written. If that template is removed, that could definitely cause the problem you’re seeing.

---

<div class="post-metadata">

### Author: ![javenfang](https://avatars.discourse-cdn.com/v4/letter/j/df705f/32.png) [@javenfang](https://meta.discourse.org/u/javenfang)
#### Post date: [2016年二月15日 06:38 UTC](https://meta.discourse.org/t/failed-to-install-due-to-not-found-root-authorized-keys-file/38873/7 "2016-02-15T06:38:49Z")

</div>

I have copied app.yml from samples/standalone.yml.

The app.yml I used is attached.  
[app (1).yml](https://global.discourse-cdn.com/meta/original/3X/d/8/d831a1635c49d495def0cc8894b325f6a1b6a065.yml) (3.9 KB)

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [2016年二月15日 09:23 UTC](https://meta.discourse.org/t/failed-to-install-due-to-not-found-root-authorized-keys-file/38873/8 "2016-02-15T09:23:28Z")

</div>

You can remove the last line. It is no longer being used.

[https://github.com/discourse/discourse\_docker/commit/a1bc8635c3c171e56d04271419a3943ccb04fe01](https://github.com/discourse/discourse_docker/commit/a1bc8635c3c171e56d04271419a3943ccb04fe01)

---

<div class="post-metadata">

### Author: ![javenfang](https://avatars.discourse-cdn.com/v4/letter/j/df705f/32.png) [@javenfang](https://meta.discourse.org/u/javenfang)
#### Post date: [2016年二月16日 02:43 UTC](https://meta.discourse.org/t/failed-to-install-due-to-not-found-root-authorized-keys-file/38873/9 "2016-02-16T02:43:42Z")

</div>

Thanks for your guide. It works ok!

---

<div class="post-metadata">

### Author: ![sirideain](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sirideain/32/101202_2.png) [@sirideain](https://meta.discourse.org/u/sirideain)
#### Post date: [2018年八月23日 13:37 UTC](https://meta.discourse.org/t/failed-to-install-due-to-not-found-root-authorized-keys-file/38873/10 "2018-08-23T13:37:53Z")

</div>

This command is still in the web\_only container.

```
[2018-08-23T13:32:36.971204 #14] INFO -- : > awk -F\# '{print $1;}' ~/.ssh/authorized_keys | awk 'BEGIN { print "Authorized SSH keys for this container:"; } NF>=2 {print $NF;}'
awk: fatal: cannot open file `/root/.ssh/authorized_keys' for reading (No such file or directory)

```

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2018年八月23日 14:06 UTC](https://meta.discourse.org/t/failed-to-install-due-to-not-found-root-authorized-keys-file/38873/11 "2018-08-23T14:06:06Z")

</div>

That’s because it should be. If you have keys, they’ll be added to the container. If you don’t, and you watch carefully, you’ll see a warning.

---

<div class="post-metadata">

### Author: ![sirideain](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sirideain/32/101202_2.png) [@sirideain](https://meta.discourse.org/u/sirideain)
#### Post date: [2018年八月23日 14:18 UTC](https://meta.discourse.org/t/failed-to-install-due-to-not-found-root-authorized-keys-file/38873/12 "2018-08-23T14:18:27Z")

</div>

I have keys configured on the VM that I use for SSH.

This same line was removed from the standalone container a couple years ago, so I wasn’t sure if it should still be in the web\_only container.
