Score:0

ssh not looking for private key at $HOME

ng flag

I have a Kubernetes pod with a persistent volume mounted at /data. I am trying to use the pod for remote development and as such, need to ensure that my private ssh key persists upon pod restart so I can continue to authenticate to GitHub without generating a new key.

I tried export HOME="/data" and pointing ssh-keygen to /data/.ssh but I was still unable to authenticate to GitHub. Presumably, ssh is not looking at /data/.ssh for my private key. What is the solution here? I do have control over the Dockerfile used for the pod if there is any config there that is necessary.

Score:1
ws flag

To keep your private SSH key alive between pod restarts and ensure SSH uses the correct place for the key. You might attempt the following steps.

  1. Include a '/data' directory within the Docker image in your Dockerfile. Then, copy your private SSH key to '/data/.ssh' and provide the key the necessary permissions.

  2. When creating your pod manifest, make sure you include a PersistentVolumeClaim(PVC) to claim the desired persistent volume for '/data'.

  3. Add volume and volume mount definitions to the pod specification to mount the PVC to the '/data' directory.

Follow the docs GitHub with SSH and Setting Up SSH Keys for more information.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.