Failed to install due to not found /root/authorized_keys file

(Javenfang) #1

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;

(Sander Datema) #2

Double check: are you using the official Docker install?

(Javenfang) #3

Yes, I am using the official guide: discourse/ at master · discourse/discourse · GitHub

(Werner M ) #4

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 (including all pre-requisites), everything checks fine and Docker started up cleanly.

Installed Discourse following the procedures outlined here. 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?

(Jeff Atwood) #5

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

(Matt Palmer) #6

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.

(Javenfang) #7

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

The app.yml I used is attached.
app (1).yml (3.9 KB)

(Alan Tan) #8

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

(Javenfang) #9

Thanks for your guide. It works ok!


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)

(Jay Pfaffman) #11

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.


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.