azure-cli: [ACS] No such file or directory: '/root/.ssh/config'

Description

I have setup kubenetes cluster in Azure using az acs command, it all worked until when I tried to connect

az acs kubernetes get-credentials --name=<clustername> --resource-group <resourcegroup>

[Errno 2] No such file or directory: ‘/root/.ssh/config’ Traceback (most recent call last): File “/usr/local/lib/python3.5/site-packages/azure/cli/main.py”, line 36, in main cmd_result = APPLICATION.execute(args) File “/usr/local/lib/python3.5/site-packages/azure/cli/core/application.py”, line 212, in execute result = expanded_arg.func(params) File “/usr/local/lib/python3.5/site-packages/azure/cli/core/commands/init.py”, line 377, in call return self.handler(*args, **kwargs) File “/usr/local/lib/python3.5/site-packages/azure/cli/core/commands/init.py”, line 626, in _execute_command reraise(*sys.exc_info()) File “/usr/local/lib/python3.5/site-packages/six.py”, line 693, in reraise raise value File “/usr/local/lib/python3.5/site-packages/azure/cli/core/commands/init.py”, line 603, in _execute_command result = op(client, **kwargs) if client else op(**kwargs) File “/usr/local/lib/python3.5/site-packages/azure/cli/command_modules/acs/custom.py”, line 814, in k8s_get_credentials _k8s_get_credentials_internal(name, acs_info, path, ssh_key_file) File “/usr/local/lib/python3.5/site-packages/azure/cli/command_modules/acs/custom.py”, line 835, in _k8s_get_credentials_internal ‘.kube/config’, path_candidate, key_filename=ssh_key_file) File “/usr/local/lib/python3.5/site-packages/azure/cli/command_modules/acs/acs_client.py”, line 63, in secure_copy conf.parse(open(ssh_config_file)) FileNotFoundError: [Errno 2] No such file or directory: ‘/root/.ssh/config’

When I tried to use below then it shows my cluster information az acs show --resource-group <resourcegroup> --name <clustername>


Environment summary

Install Method: How did you install the CLI? (e.g. pip, interactive script, apt-get, Docker, MSI, nightly)
i am using AZ, docker

CLI Version: What version of the CLI and modules are installed? (Use az --version)
Answer here: ash-4.3# az --version azure-cli (2.0.18+dev)

acr (2.0.12+dev) acs (2.0.16+dev) appservice (0.1.17+dev) backup (1.0.1+dev) batch (3.1.4+dev) billing (0.1.5+dev) cdn (0.0.9+dev) cloud (2.0.8+dev) cognitiveservices (0.1.8+dev) command-modules-nspkg (2.0.1+dev) component (2.0.7+dev) configure (2.0.11+dev) consumption (0.1.5+dev) container (0.1.11+dev) core (2.0.17+dev) cosmosdb (0.1.13+dev) dla (0.0.12+dev) dls (0.0.14+dev) eventgrid (0.1.4+dev) extension (0.0.3+dev) feedback (2.0.6+dev) find (0.2.7+dev) interactive (0.3.10+dev) iot (0.1.12+dev) keyvault (2.0.11+dev) lab (0.0.11+dev) monitor (0.0.10+dev) network (2.0.15+dev) nspkg (3.0.1+dev) profile (2.0.13+dev) rdbms (0.0.7+dev) redis (0.2.9+dev) resource (2.0.15+dev) role (2.0.12+dev) servicefabric (0.0.4+dev) sql (2.0.12+dev) storage (2.0.16+dev) taskhelp (0.1.7+dev) vm (2.0.15+dev)

Python location ‘/usr/local/bin/python’ Extensions directory ‘/root/.azure/cliextensions’ OS Version: What OS and version are you using?
Answer here: MAC os 10.12.6 Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
Answer here: bash

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 3
  • Comments: 24 (8 by maintainers)

Most upvoted comments

@lenadroid @qx-will

The cloud shell still contains the 2.0.18 ACS module. It will be upgraded in the coming week.

Worked, thanks!

#4646 should resolve the issue, and along with proxycommand error.

@lenadroid , can you check the acs module version? We have known the issue in acs module 2.0.17. And It should be fixed just after that.

@qx-will cloud shell is using 2.0.17, it is supposed to NOT work.

@IainColledge 's workaround is right, it give you acs module 2.0.16, which is still good.

I’ve got the same problem on Windows: ERROR: [Errno 2] No such file or directory: ‘C:\Users\myName/.ssh/config’

My version of azure-cli is 2.0.19

Just tried to create the folder and the error little bit changed: az : ERROR: [Errno 13] Permission denied: ‘C:\Users\myName/.ssh/config’

Commands are executed under Administrator’s privileges.

In case someone got stuck on this issue: workaround is to use version 2.0.18