0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

sftp.jsonでパスフレーズを毎回入力して認証する方法

Posted at

vscodeのSFTPプラグイン、利用されてるかたも多いと思います。
わたしも先日使い始めましたが、秘密鍵のパスフレーズをそのまま記載するのはなんか気持ち悪い感じがして、毎回入力する方法を調べてみました。

Webで色々探してもなかなか出てこなかったんですが、公式のリポジトリ行ったら普通に書いてました。なんなんよ……笑

passphrase
mixed: For an encrypted private key, this is the passphrase string used to decrypt it. Set to true for enabling passphrase dialog. This will prevent from using cleartext passphrase in this config.

というわけで、passphraseの項目をtrueにすることで、毎回ダイアログが開いてログインすることができました。

サンプル
{
  "name": "APP",
  "host": "999.999.999.999",
  "protocol": "sftp",
  "port": 22,
  "username": "apache",
  "passphrase": true,
  "privateKeyPath": "~/.ssh/xxxxxxxx",
  "remotePath": "/var/www/xxx/yyy/zzz",
  "uploadOnSave": false,
  "ignore": [
      ".vscode",
      ".git"
  ]
}

fork元のSFTPプラグインのissueに、interactiveAuthtrueにするとか書いてましたが、これはどっちでもよさそうでした。あえてfalse設定してもパスフレーズのダイアログは開きました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?