vscode-deploy-reloaded icon indicating copy to clipboard operation
vscode-deploy-reloaded copied to clipboard

Using SSH Private Key requires password stored in plain text

Open IamTheFij opened this issue 7 years ago • 6 comments

Description

Unable to receive a prompt for SSH Private Key passphrase

Actual behavior

When adding a private key to the configs, I get failures due to missing passphrase

Expected behavior

I expect a prompt asking me for my passphrase, as with the username/password auth.

Steps to reproduce

Add an encrypted private key to the config but do not add the passphrase. Attempt to deploy a file.

Example config

{
    "deploy.reloaded": {
        "packages": [
            {
                "name": "Full",
                "files": [
                    "/**/*"
                ]
            }
        ],
        "targets": [
            {
                "type": "sftp",
                "name": "devbox",
                "description": "My devbox",
                "dir": "/nail/home/iamthefij/workspace/my_project",
                "host": "my-server",
                "privateKey": "/Users/iamthefij/.ssh/id_rsa",
                "user": "iamthefij"
            }
        ]
    }

Logs

🔥 [ERROR] Could not deploy files to 'devbox': 'Encrypted private key detected, but no passphrase given'

Screenshot

N/A

Your environment

  • Operating system: macOS
  • Visual Studio Code version: 1.24.0
  • Extension version: 0.75.0

Additional comments

This is probably a feature request...

IamTheFij avatar Jun 11 '18 18:06 IamTheFij

+1 It would be nice to add features like:

  • alwaysAskForPrivateKeyPassphrase - Always ask for privateKeyPassphrase and do not cache, if no user is defined.
  • askForPrivateKeyPassphrase - Ask for privateKeyPassphrase and cache, if no user is defined.

I really miss the cache feature for alwaysAskForPassword and alwaysAskForUser when I do a lot of changes to the project :(

Zaczero avatar Jun 24 '18 20:06 Zaczero

@IamTheFij @Zaczero

Sorry, that I am answer so late!

I implemeted the both settings alwaysAskForPrivateKeyPassphrase and askForPrivateKeyPassphrase in version 0.81.1.

mkloubert avatar Jul 02 '18 23:07 mkloubert

Thanks!
How about askForPassword (cached version of alwaysAskForPassword) and askForUser (also cache)? Any chance for getting these?

They should work similar to askForPrivateKeyPassphrase that you have just added.
It would be perfect 🦀

Zaczero avatar Jul 03 '18 00:07 Zaczero

@Zaczero

Sorry, my mistake.

I will implement them soon.

mkloubert avatar Jul 03 '18 01:07 mkloubert

@mkloubert no problem, it's kinda late already so I understand :)
Love your extension ❤️

Zaczero avatar Jul 03 '18 01:07 Zaczero

The askForPassword and askForUser settings are implemented for FTP and SFTP now (since version 0.82.0).

mkloubert avatar Jul 03 '18 14:07 mkloubert