LoginSignup
5
5

More than 5 years have passed since last update.

Mercurialで安全にパスワードを保存する

Posted at

Mercurialでパスワードを保存するには、以下のように記述する方法があります。

~/.hgrc
[auth]
example.com.prefix = https://example.com
example.com.user = xxxxxxx
example.com.password = xxxxxxx

ですが、生パスワードを記述するので安全とは言えません。
そこでMercurial-Keyring拡張を使います。
以下のように、この拡張を有効にしてパスワード設定を削除しておくと、初回のみパスワード入力を要求されてパスワードデータデースに保存されます。
次回からはパスワードデータデースを利用するため安全にパスワードを保管できます。

~/.hgrc
[extensions]
mercurial_keyring = /path/to/mercurial_keyring.py

[auth]
example.com.prefix = https://example.com
example.com.user = xxxxxxx

Windows版のTortoiseHGはこの拡張が同梱されているので、以下の設定だけで有効にできます。

Mercurial.ini
[extensions]
mercurial_keyring =

その他、パスワードの保存先など詳しくはTortoiseHg v1.0.0 documentation/8.5. Mercurial-Keyringに記載されているので参考にしてください。

5
5
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
5
5