jeroenpeeters / docker-ssh

SSH Server for Docker containers ~ Because every container should be accessible
GNU General Public License v2.0
645 stars 90 forks source link

Need more details on authentication via RSA key #28

Closed namgivu closed 7 years ago

namgivu commented 7 years ago

I follow your readme file https://github.com/jeroenpeeters/docker-ssh#publickey and from there, we can get the SSH authorized by private key via extra params

  -e AUTH_MECHANISM=publicKey \
  -e AUTHORIZED_KEYS=/authorized_keys \

where authorized_keys file containing a list of public keys. Does it mean the value of param AUTHORIZED_KEYS to be the path to a file on the host machine (i.e. NOT the container)?

p.s.

I also see in the next section at https://github.com/jeroenpeeters/docker-ssh#server-identity-and-security, you mentioned about -v /path/to/my/key:/my_key -e KEYPATH=/my_key - I guess this is where I define the private key for the SSH authentication, and put the public key to param AUTHORIZED_KEYS above, right?

namgivu commented 7 years ago

I got the answer for my question "Does it mean the value of param AUTHORIZED_KEYS to be the path to a file on the host machine?" - it is the file mapped to the one on host machine mapped by -v ./authorized_keys:/authorized_keys param