question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ACS k8s get-credentials encrypted private key

See original GitHub issue

When running the az acs kubernetes get-credentials command it errors out saying PasswordRequiredException: Private key file is encrypted. I am on macOS and my private key is password protected.

Please find the logs here:

user@host: az acs kubernetes get-credentials -n $CLUSTER_NAME -g $RESOURCE_GROUP          
Private key file is encrypted
Traceback (most recent call last):
  File "/Users/williamseandon/Library/Python/2.7/lib/python/site-packages/azure/cli/main.py", line 35, in main
    cmd_result = APPLICATION.execute(args)
  File "/Users/williamseandon/Library/Python/2.7/lib/python/site-packages/azure/cli/core/application.py", line 146, in execute
    result = expanded_arg.func(params)
  File "/Users/williamseandon/Library/Python/2.7/lib/python/site-packages/azure/cli/core/commands/__init__.py", line 295, in _execute_command
    result = op(client, **kwargs) if client else op(**kwargs)
  File "/Users/williamseandon/Library/Python/2.7/lib/python/site-packages/azure/cli/command_modules/acs/custom.py", line 534, in k8s_get_credentials
    '.kube/config', path_candidate)
  File "/Users/williamseandon/Library/Python/2.7/lib/python/site-packages/azure/cli/command_modules/acs/acs_client.py", line 21, in SecureCopy
    ssh.connect(host, username=user, key_filename=os.path.join(home, '.ssh', 'id_rsa'))
  File "/Users/williamseandon/Library/Python/2.7/lib/python/site-packages/paramiko/client.py", line 380, in connect
    look_for_keys, gss_auth, gss_kex, gss_deleg_creds, gss_host)
  File "/Users/williamseandon/Library/Python/2.7/lib/python/site-packages/paramiko/client.py", line 621, in _auth
    raise saved_exception
PasswordRequiredException: Private key file is encrypted

A quick search leads to http://stackoverflow.com/questions/15579117/paramiko-using-encrypted-private-key-file-on-os-x . Looks like there may bean issue with paramiko and macOS’s keyring? Let me know if I’m completely off base. I was able to copy the kube config from the master node via scp.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:26 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
dottorblastercommented, May 12, 2017

Is this issue still open? I see this closed but I’m getting:

$ az acs kubernetes get-credentials --resource-group=k8s-dottorblaster --name=containerservice-k8s-dottorblaster
Private key file is encrypted
Traceback (most recent call last):
  File "/Users/blaster/lib/azure-cli/lib/python2.7/site-packages/azure/cli/main.py", line 36, in main
    cmd_result = APPLICATION.execute(args)
  File "/Users/blaster/lib/azure-cli/lib/python2.7/site-packages/azure/cli/core/application.py", line 203, in execute
    result = expanded_arg.func(params)
  File "/Users/blaster/lib/azure-cli/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 278, in __call__
    return self.handler(*args, **kwargs)
  File "/Users/blaster/lib/azure-cli/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 473, in _execute_command
    reraise(*sys.exc_info())
  File "/Users/blaster/lib/azure-cli/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 450, in _execute_command
    result = op(client, **kwargs) if client else op(**kwargs)
  File "/Users/blaster/lib/azure-cli/lib/python2.7/site-packages/azure/cli/command_modules/acs/custom.py", line 690, in k8s_get_credentials
    _k8s_get_credentials_internal(name, acs_info, path, ssh_key_file)
  File "/Users/blaster/lib/azure-cli/lib/python2.7/site-packages/azure/cli/command_modules/acs/custom.py", line 711, in _k8s_get_credentials_internal
    '.kube/config', path_candidate, key_filename=ssh_key_file)
  File "/Users/blaster/lib/azure-cli/lib/python2.7/site-packages/azure/cli/command_modules/acs/acs_client.py", line 49, in SecureCopy
    ssh.connect(host, username=user, pkey=pkey)
  File "/Users/blaster/lib/azure-cli/lib/python2.7/site-packages/paramiko/client.py", line 381, in connect
    look_for_keys, gss_auth, gss_kex, gss_deleg_creds, gss_host)
  File "/Users/blaster/lib/azure-cli/lib/python2.7/site-packages/paramiko/client.py", line 622, in _auth
    raise saved_exception
PasswordRequiredException: Private key file is encrypted

I have a passphrase protected keyfile.

1reaction
dottorblastercommented, Jun 3, 2017

OMG you are the best.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Distribute Credentials Securely Using Secrets - Kubernetes
Distribute Credentials Securely Using Secrets. This page shows how to securely inject sensitive data, such as passwords and encryption keys, ...
Read more >
Errors trying to connect to Kubernetes web UI - Stack Overflow
Do you execute az acs kubernetes get-credentials ... I suggest you could check your private key and execute the command again.
Read more >
Setup Kubernetes Ingress with SSL-Passthrough - Azure Talk
Create the Kubernets Cluster (ACS). First an Azure Container Service is created with Kubernetes as orchestrator and then the credentials are ...
Read more >
Restrict egress traffic in Azure Kubernetes Service (AKS)
This article provides the necessary details that allow you to secure outbound traffic from your Azure Kubernetes Service (AKS).
Read more >
Containerizing A .NET Core Application Using Docker, ACS ...
To create Secure Shell (SSH) RSA keys, see the OS X and Linux or Windows guidance. Service principal client ID and secret (Kubernetes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found