Asking for help? Comment out what you need so we can get more information to help you!
Cluster information:
Kubernetes version: 1.19
Cloud being used: on-perm
Installation method: i believe kubeadm
Host OS: ubuntu
Hi, I have a business requirement to SSH as a non-root into kubernetes pod and this is already in traditional server setup, just moving the same to k8s.
Have installed metallb. I created my set of private and public keys. Add the public key and sshd_config ( PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM no) as configmap and mounted as volumes (/root/.ssh/authorized_keys).
Created a LB type service which bind the pod with metallb ip.
Able to ssh using ssh root@metallbip.
Added the non-root user in /etc/group and /etc/passwd, public key under /home/xyz/.ssh/authorized_keys.If i mount this using configmap, the ownership is root:root.
So I added them in dockerimage itself, updated the ownership to xyz:xyz’s group and permission to 0600, created pod in k8s cluster. But getting “xyz@metallbip: Permission denied (publickey)”.
I think am missing something when I want to ssh as a non root user. Am running the pod and openssh-server as root.