Quantcast
Channel: redtower's memo » Apache
Viewing all articles
Browse latest Browse all 5

1.3.5 ApacheのDigest認証ファイルを作成する。

$
0
0
  • htdigestコマンドを使って作成する。
    htdigest [-c] <passwdfile> <realm> <username>

    Digest認証ファイル(.htdigest)をユーザ(johnny)、レルム(foobar)、パスワード(pass)で新規に作成する。

    $ htdigest -c .htdigest foobar johnny
    Adding password for johnny in realm foobar.
    New password:                    ← パスワード(pass)を入力
    Re-type new password:        ← パスワード(pass)を再入力
    $ cat .htdigest
    johnny:foobar:9ba40e6dab026a90822a6d7e464e52d5

  • perlを使って作成する。
    $ perl -MDigest::MD5 -e '
    $u = "johnny";
    $r = "foobar";
    $p = "pass";
    $ctx = Digest::MD5->new;
    print "$u:$r:" . $ctx->add("$u:$r:$p")->hexdigest;'
    > .htdigest
    $ cat .htdigest
    johnny:foobar:9ba40e6dab026a90822a6d7e464e52d5


ref. http://d.hatena.ne.jp/inuz/20070708/p1
ref. http://hisashim.livejournal.com/427153.html


Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images