Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote SSH execution fails if private key has passphrase #126

Closed
wintermute000 opened this issue Jun 9, 2018 · 11 comments
Closed

Remote SSH execution fails if private key has passphrase #126

wintermute000 opened this issue Jun 9, 2018 · 11 comments

Comments

@wintermute000
Copy link

Environment

Win10
Extension 0.2.6

Summary

Trying to use remote SSH execution with a server that utilizes SSH key with passphrase.
There is nowhere in instructions or config sample JSON to provide passphrase so the SSH fails.
If I try to add a passphrase field in the JSON, it treats it as invalid

Reproduce steps

Use SSH server that has SSH key + passphrase

Copying c:\Users\xxx\Documents\Untitled-1.yml to xxx.xxx.xxx.xxx..
Failed to copy c:\Users\xxx\Documents\Untitled-1.yml to xxx.xxx.xxx.xxx: scp error: Error: Encrypted private key detected, but no passphrase given

Expected Results

Remote execution of playbook/copy of workspace via SSH
either prompt for passphrase or allow to store in servers.json

Actual Results

Configuration of .ssh/servers.json should have field for passphrase and it should work

[
{
"host": "xx.xxx.xxx.xxx",
"port": 22,
"user": "xxx",
"password": "xxx",
"key": "C:/Users/xxx/xxx/ssh/id_rsa"
}
]

@yungezz
Copy link
Contributor

yungezz commented Jun 11, 2018

@wintermute000 thanks for reporting the issue, we're working on fixing. will update later.

@yungezz
Copy link
Contributor

yungezz commented Jul 24, 2018

fixed in PR #127 , released in v0.3.0. pls have a try and let us know if any other problems.

@yungezz yungezz closed this as completed Jul 24, 2018
@wintermute000
Copy link
Author

how do I used it? I tried to add a passphrase keypair but that didn't do it.

@yungezz
Copy link
Contributor

yungezz commented Jul 26, 2018

if you've updated your remote host entry in $HOME/.ssh/servers.json with passphrase as below:

  {
    "host": "sssss",
    "port": 22,
    "user": "username",
    "key": "/xxx/xxx/xxx",
    "passphrase": "aaaaa"
  }

then just trigger run playbook remotely via ssh.

@wintermute000
Copy link
Author

No matter how I edit C:\user<user>.ssh\servers.json, it always reverts back. am I doing anything wrong?

This is in Win10.

@yungezz
Copy link
Contributor

yungezz commented Jul 26, 2018

are you following "Add New Host" process everytime when "run playbook rermotely via ssh", in the wizard, it will pop up a list with remote hosts in your servers.json, pick it from existing list.

@wintermute000
Copy link
Author

If I follow add new host, I don't get any option to add a SSH key or passphrase.

If I edit c:\users\XYZ.ssh\servers.json, it seems to change every time.

@yungezz
Copy link
Contributor

yungezz commented Jul 26, 2018

when add new host, type "enter" directly when asking for ssh password, then you'll see input box for key file path, then passphrase.

image

@wintermute000
Copy link
Author

Great, that's clear now, works.
Second problem, how do I specify hosts? normally would run -i hosts...

@yungezz
Copy link
Contributor

yungezz commented Jul 27, 2018

use configuration item ansible.customOptions. pls see more detail in readme.md.

@wintermute000
Copy link
Author

wintermute000 commented Jul 27, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants