From 83e424405905a172cf9ee777ff8707983bbeeec5 Mon Sep 17 00:00:00 2001 From: dave Date: Sun, 7 Oct 2018 15:21:44 -0700 Subject: [PATCH] support ssh authorized keys --- Dockerfile | 10 ++++++---- README.md | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index b5bc705..7110858 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,15 @@ FROM ubuntu:bionic -# Nexus user for application usage -RUN useradd --create-home nexus && \ - echo "nexus:nexus" | chpasswd - # Packages RUN apt-get update && \ apt-get install -y nginx-light fcgiwrap supervisor openssh-server cron rsync python3-pip +# Nexus user for application usage +RUN useradd --create-home nexus && \ + echo "nexus:nexus" | chpasswd && \ + install -d /home/nexus/.ssh -o nexus -g nexus -m 700 && \ + ln -s /data/nexus_authorized_keys /home/nexus/.ssh/authorized_keys + # Misc conf RUN mkdir /start.d /nexus /var/run/sshd && \ chown nexus /nexus && \ diff --git a/README.md b/README.md index 2536794..2f0921b 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,8 @@ Nexus offers a couple services: For shell related activities, an sshd daemon runs on the standard port. Username and password, by default, is `nexus`. -Mount `/data/keys` to persist host keys. +Mount `/data/keys` to persist host keys. Ssh public keys in `/data/nexus_authorized_keys` will be authorized for the +`nexus` user. ### Nginx