RedpointArchive / phabricator

A Docker image that runs Phabricator, an open source software engineering tool
https://hub.docker.com/r/redpointgames/phabricator/
307 stars 98 forks source link

sshd not listening #96

Closed milekz closed 6 years ago

milekz commented 6 years ago

It is expected that port sshd at port 22 wll be up and running for ssh/git repo

e57ebb12dfe3:/sbin # ss -lntupw  
Netid State      Recv-Q Send-Q                              Local Address:Port                                             Peer Address:Port              
udp   UNCONN     0      0                                      127.0.0.11:53193                                                       *:*                  
tcp   LISTEN     0      128                                             *:80                                                          *:*                   users:(("nginx",pid=51,fd=6))
tcp   LISTEN     0      128                                    127.0.0.11:39889                                                       *:*                  
tcp   LISTEN     0      128                                             *:24                                                          *:*                   users:(("sshd",pid=18729,fd=3))
tcp   LISTEN     0      100                                     127.0.0.1:25                                                          *:*                  
tcp   LISTEN     0      128                                             *:443                                                         *:*                   users:(("nginx",pid=736,fd=6))
tcp   LISTEN     0      128                                     127.0.0.1:22280                                                       *:*                  
tcp   LISTEN     0      128                                     127.0.0.1:9000                                                        *:*                   users:(("php-fpm",pid=47,fd=7))
tcp   LISTEN     0      128                                     127.0.0.1:22281                                                       *:*                  
tcp   LISTEN     0      128                                            :::24                                                         :::*                   users:(("sshd",pid=18729,fd=4))
e57ebb12dfe3:/sbin # /usr/sbin/sshd
Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Could not load host key: /etc/ssh/ssh_host_ed25519_key
e57ebb12dfe3:/sbin # 
milekz commented 6 years ago

my bad i didn't set PHABRICATOR_HOST_KEYS_PATH proper way

herzke commented 6 years ago

Would be nice to share what the proper way is.

Documentation says

    --env PHABRICATOR_HOST_KEYS_PATH=/hostkeys/persisted \
    -v /path/on/host:/hostkeys \

but it does not say whether appropriate host keys should already exist in /path/on/host, or if they will be created there.

hach-que commented 6 years ago

The host keys should be automatically generated on first run, but the path to store them in must already exist.

herzke commented 6 years ago

I can confirm that the host keys are created on first run and stored there. Also the subdirectory "persisted" is created on first run. It does not need to exist before the first start.

I have used a docker volume for this purpose:

  --env PHABRICATOR_HOST_KEYS_PATH=/hostkeys/persisted      \
  -v phab01-keys:/hostkeys               \

which creates a new docker volume for the keys for this phabricator instance, named phab01-keys.