Let’s Encryptに登録したメールアドレスを変更する方法

投稿者 : OSCA

[PR] 関東地方の美しい夜景を観にいこう。 夜景サイト「夜景散歩」で夜景スポットを検索

無料で SSL/TLS 証明書を発行できる Let’s Encrypt を利用し始める際にメールアドレスを登録しますが、管理者が変更になった場合などにそのメールアドレスを変更したい場合があります。 本稿では、その Let’s Encrypt に登録したメールアドレスを変更する方法について解説します。

登録済みのメールアドレスを確認する方法

まずは現在登録されているメールアドレスを確認しましょう。 それを確認する certbot のコマンドは提供されていないので、設定ファイルを直に確認する必要があります。 確認すべき設定ファイルは次のいずれかです。 Let’s Encrypt を導入した時期により存在するファイルが異なります。 以前は regr.json にメールアドレスが保存されていましたが、直近だと meta.json に保存されています。 (hash値 は環境により異なります)

  • /etc/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory/(hash値)/regr.json
  • /etc/letsencrypt/accounts/acme-v02.api.letsencrypt.org/directory/(hash値)/regr.json
  • /etc/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory/(hash値)/meta.json
  • /etc/letsencrypt/accounts/acme-v02.api.letsencrypt.org/directory/(hash値)/meta.json

ファイルを cat コマンドなり less コマンドなりで開きます。 するとJSONの中に"register_to_eff":"hogemoge@hogemoge.net"もしくは "contact": ["mailto: hogemoge@hogemoge.net"] のような記述があり、それが現在登録してあるメールアドレスです。

regr.json に保存されている場合
$ cat /etc/letsencrypt/accounts/acme-v02.api.letsencrypt.org/directory/(hash値)/regr.json
{"body": {"contact": ["mailto:hogemoge@hogemoge.net"], "agreement": "https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf", (以下略)

meta.json に保存されている場合
$ cat /etc/letsencrypt/accounts/acme-v02.api.letsencrypt.org/directory/(hash値)/meta.json
{"creation_host": "hogemoge.vs.sakura.ne.jp", "register_to_eff": "hogemoge@hogemoge.net", "creation_dt": "2016-03-21T01:52:56Z"}
 

メールアドレスを変更する方法

現在設定されているメールアドレスの確認ができたら、新しいメールアドレスに変更します。 メールアドレスの変更は、次のような certbot コマンドを利用して行えます。

certbot update_account --email 'メールアドレス'

実際に実行した例が以下の通りです。

# certbot update_account --email 'new.hogemoge@hogemoge.net'
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfully issued, to
share your email address with the Electronic Frontier Foundation, a founding
partner of the Let's Encrypt project and the non-profit organization that
develops Certbot? We'd like to send you email about our work encrypting the web,
EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Your e-mail address was updated to new.hogemoge@hogemoge.net.

コマンドを実行すると「登録するメールアドレス宛にニュースやキャンペーンなどのメールを送っても良いか?」と聞かれますので、「Y」もしくは「N」で回答します。 すると Your e-mail address was updated と表示され、無事にメールアドレスの変更が完了しました。

Let's Encryptのトップへ戻る

著者 : OSCA

OSCA

Java, PHP 系のWEBエンジニア。 WEBエンジニア向けコミュニティ「WEBエンジニア勉強会」を主催。 個人として何か一つでも世の中の多くの人に使ってもらえるものを作ろうと日々奮闘中。
@engineer_osca