Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Expose Default Docker User for Easier SSH Access #399

Open
andylizf opened this issue Feb 12, 2025 · 0 comments
Open

Feature Request: Expose Default Docker User for Easier SSH Access #399

andylizf opened this issue Feb 12, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@andylizf
Copy link

andylizf commented Feb 12, 2025

Is your feature request related to a problem? Please describe.

Yes - we would like to retrieve the default user set in a Docker image (defined by the USER instruction in the Dockerfile) when launching pods on RunPod. This is particularly useful for tools like SkyPilot, which rely on SSH access to the container. Currently, SSH attempts default to the root user, which fails when the image uses a non-root user. This leads to connection errors like:

RuntimeError: Failed to SSH to 213.181.111.2 after timeout 600s, with Error: ConnectionRefusedError: [Errno 111] Connection refused

We’ve worked around this issue by manually setting an environment variable SKYPILOT_DOCKER_SSH_USERNAME in skypilot-org/skypilot#4683, but this approach is not scalable or convenient for dynamic environments.

Describe the solution you'd like

We’d like RunPod to expose the default user of the Docker image through its API or container metadata. This could be done by adding a field in the create_pod API response or by providing an option to query the default user when the pod starts. This would allow automation tools to dynamically detect the correct SSH user without manual intervention.

Describe alternatives you've considered

  • Let user manually specify the docker user for each custom image, which adds overhead and is error-prone.
  • Using entrypoint scripts to detect and export the current user, but this complicates image maintenance and adds too much overheads.

Additional context

This issue surfaced while using SkyPilot to launch clusters on RunPod with custom images that have non-root default users. The current SSH mechanism attempts to connect as root, causing connection failures. Here’s a related SkyPilot issue for reference: skypilot-org/skypilot#4282.

Implementing this feature would improve compatibility with images following best practices (non-root users by default) and streamline automation workflows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant