Skip to content

Suggested configuration block for SSH client doesn't work #8122

@msusta

Description

@msusta

Problem

If you want to use the toolkit integration to connect to SageMaker instance you get a notification to add a configuration block to .ssh/config that's supposed to simplify the connections to them.
However the supplied block is incorrect on latest OpenSSH version.

Steps to reproduce the issue

  1. Make sure no generated configuration from Toolkit is in your .ssh/config
  2. Use VScode with AWS Toolkit 3.77 (latest for me ATM)
  3. Try connecting to SageMaker AI space
  4. You're presented with dialog to add configuration to .ssh/config
  5. Following code is put into there:
# Created by AWS Toolkit for VSCode. https://github.com/aws/aws-toolkit-vscode
Host sm_*
    ForwardAgent no
    #AddKeysToAgent yes
    StrictHostKeyChecking no
    ProxyCommand '/home/msusta/.config/Code/User/globalStorage/amazonwebservices.aws-toolkit-vscode/sagemaker_connect' '%n'
    User '%r'
  1. First connection works for whatever reason
  2. Next connection attempt fails on ssh -G sm_test with
vdollar_percent_expand: unknown key %r
percent_dollar_expand: failed

Expected behavior

OpenSSH doesn't allow usage of '%r' in User option. Not sure why that's passed in there.

Workaround

Set the option User to sagemaker-user when using the default SageMaker distribution.

System details (run AWS: About and/or Amazon Q: About)

  • OS: Debian Linux 13.1 (Trixie)
  • Visual Studio Code version: 1.104
  • AWS Toolkit version: 3.77
  • OpenSSH: 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugWe can reproduce the issue and confirmed it is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions