Public key path question/issue (openssh-server)

(I tried to tag this for the openssh-server but Discourse wouldn’t let me)

I’m having a little trouble getting this going the way I would like it to. Quite simple, actually, I want to plug in multiple public keys and allow them to auth for SCP file transfers.

The documentation suggests this is the way to go:

- PUBLIC_KEY_DIR=[valid path on the host machine?]
- PUBLIC_KEY_DIR=/home/username/appdata/scp-server/pubkeys

So I create a folder and a file within the folder. In the file I paste my public SSH key:

ssh-rsa AAAAB[omitted for security reasons]oaCew== username

So I start the container, can’t SSH in. I shell into the container and there’s nothing in the authorized_keys file, it’s empty

Initially, the file containing my key was just username. I tried changing it to, still nothing, I tried changing it from a directory to an actual filename, so the mount is a file and not a directory, still no joy.

I guess my first question is does this directory need to be a volume mount? If not, is there a format to the filename? Permissions?

[migrations] started
[migrations] no migrations found
usermod: user 'abc' does not exist
groupmod: group 'abc' does not exist
usermod: no changes

      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 

   Brought to you by

To support LSIO projects visit:


User UID:    0
User GID:    0

User name is set to username
sudo is disabled.
sshd is listening on port 2222
User/password ssh access is disabled.
[custom-init] No custom files found, skipping...
[] done.

All paths defined in environment variables need to be accessible from inside the container at the specified path

1 Like

Thank you and my apologies. I had a suspicion that could’ve been it but it’s not stated. I’m also ill so my brain is operating at like 25%.

For reference or anyone else in the future, I turned it back into a directory called pubkeys. Then changed the environment flag to - PUBLIC_KEY_DIR=/pubkeys and added a volume mount - /home/username/appdata/scp-server/pubkeys:/pubkeys and the key is imported into the container on restart.

Now to figure out why SCP transfers only 13KB of a 2GB file…

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.