az acs kubernetes get-credentials --ssh-key-file does not override searching in .ssh for release 2.0.4
See original GitHub issueDescription
Outline the issue here:
When using a custom ssh key with the command line option --ssh-key-file for az acs kubernetes get-credentials if a file exists in .ssh in the users home dir the command fails with Authentication Failed.
Looking at debug for
az acs kubernetes get-credentials --resource-group=<rg> --name=<acsn> --ssh-key-file=<key_rsa> --debug
results in the relevant output as follows:
...
paramiko.transport : kex engine KexGroup14 specified hash_algo <built-in function openssl_sha1>
paramiko.transport : Switch to new keys ...
paramiko.transport : Adding ssh-rsa host key for aitcacs-aitcpoc-59688e.westeurope.cloudapp.azure.com: <host key>
paramiko.transport : Trying discovered key <private key> in /root/.ssh/id_rsa
paramiko.transport : userauth is OK
paramiko.transport : Authentication (publickey) failed.
Authentication failed.
Traceback (most recent call last):
...
When using acs 2.0.3 the same command and section will result in
...
paramiko.transport : kex engine KexGroup14 specified hash_algo <built-in function openssl_sha1>
paramiko.transport : Switch to new keys ...
paramiko.transport : Adding ssh-rsa host key for aitcacs-aitcpoc-59688e.westeurope.cloudapp.azure.com: < host key >
paramiko.transport : Trying SSH key < custom private key >
paramiko.transport : userauth is OK
paramiko.transport : Authentication (publickey) successful!
...
The workaround is to use 2.0.3, install using
pip install azure-cli-acs==2.0.3
sudo as required.
Environment summary
Install Method: How did you install the CLI? (e.g. pip, interactive script, apt-get, Docker, MSI, nightly)
Answer here:
Inside Dockerfile.
pip install azure-cli
CLI Version: What version of the CLI and modules are installed? (Use az --version
)
Answer here:
azure-cli (2.0.4)
acr (2.0.2)
acs (2.0.4)
appservice (0.1.4)
batch (2.0.2)
cloud (2.0.2)
command-modules-nspkg (2.0.0)
component (2.0.3)
configure (2.0.4)
container (0.1.4)
core (2.0.4)
documentdb (0.1.4)
feedback (2.0.2)
find (0.2.1)
iot (0.1.4)
keyvault (2.0.2)
lab (0.0.3)
monitor (0.0.3)
network (2.0.4)
nspkg (3.0.0)
profile (2.0.4)
redis (0.2.1)
resource (2.0.4)
role (2.0.3)
sql (2.0.2)
storage (2.0.4)
vm (2.0.4)
OS Version: What OS and version are you using?
Answer here:
uname -a
Linux c70b581eafa2 4.4.0-74-generic #95-Ubuntu SMP Wed Apr 12 09:50:34 UTC 2017 x86_64 GNU/Linux
Docker base image openjdk:8
Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
Answer here:
bash
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top GitHub Comments
Update: it is fixed, per the other issue about ssh-add. So, if you fail using a key that hasn’t been added:
Then you try adding it and import the creds again:
you have success, per this item.
Thanks very much everyone.