Skip to content

[Bug]: --ssh-identity Flag in dstack apply is Ignored #2317

@movchan74

Description

@movchan74

Steps to reproduce

  1. Run the following command to apply a deployment using a custom SSH identity file:
    dstack apply -f app.dstack.yaml --ssh-identity ./id_rsa
  2. Observe that instead of using the specified SSH identity file (./id_rsa), dstack defaults to the user’s key at:
    /home/aleksandr/.dstack/ssh/id_rsa
    
  3. This occurs even though --ssh-identity was explicitly provided in the command.

Actual behaviour

  • dstack apply ignores the --ssh-identity flag and continues using the default key at /home/aleksandr/.dstack/ssh/id_rsa.
  • Repo configuration does not contain the correct path to the SSH identity file.
  • This issue can be traced to repo_config, which does not correctly store the specified identity file.

Expected behaviour

  • The --ssh-identity flag should override the default key and use the specified SSH key (./id_rsa).
  • The correct SSH key should be passed to the run configuration, allowing for proper authentication.

dstack version

0.18.41

Server logs

Additional information

  • My goal is to use my own SSH key so I can connect from any other server or user using:
    dstack attach <run_name> --ssh-identity ./id_rsa
  • Since dstack apply does not set the correct SSH key, dstack attach does not work as expected when trying to connect from another server.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingno-stale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions