"SSH Public Keys" in account settings are completely ignored

Hello, I am trying to access the env variables, as well as standard PUBLIC_KEY variable, that I specify for my pod from my python app. However they are only set when I am connecting with ssh via proxy server. Proxy is extremely slow and does not allow scp to be run through it. When I try to connect directly (via public ip), the ~/.ssh/authorized_keys is not configured at all with the public key I set in the settings. The env vars that I pass during the pod creation are also missing. Two problems: - why isn't the ~/.ssh/authorized_keys file created and populated with my public key from account settings - why env variables are missing when connecting directly via public ip to my instance? I assume proxy has some .bashrc which is activated when I connect through it, but why the env vars are not set with -e parameter in docker run command for the pod?
Solution:
in your running pod xargs -0 -L1 -a /proc/1/environ will list the environment variables that the process is getting, which is launched on container start. if there is a PUBLIC_KEY given to your pod, it will be there. if this process is a bash and doesn't export those variables when starting other processes, it will be the only process who knows about your PUBLIC_KEY
Jump to solution
4 Replies
Madiator2011
Madiator20117mo ago
Usually on official RunPod templates ssh keys at injected on start on community templates not sure. If you looking for easy way to setup true ssh with password I made tool for that https://pypi.org/project/OhMyRunPod/
Solution
Wolfsauge
Wolfsauge7mo ago
in your running pod xargs -0 -L1 -a /proc/1/environ will list the environment variables that the process is getting, which is launched on container start. if there is a PUBLIC_KEY given to your pod, it will be there. if this process is a bash and doesn't export those variables when starting other processes, it will be the only process who knows about your PUBLIC_KEY
Madiator2011
Madiator20117mo ago
btw it also depends on the template
dedpihto5375
dedpihto5375OP7mo ago
@Wolfsauge thank you very much, will come up with some workaround to export them globally
Want results from more Discord servers?
Add your server