LoginSignup
4
4

More than 5 years have passed since last update.

web2pyのadminのpassword

Posted at

web2pyの作者,Pierroさんは今web3pyの名前でPython3対応版に着手しているようです.

web2pyのadmin画面へのログインパスは,規定値がmd5になってます.なんかちょっとやですね.なんとなく.

web2py/applications/admin/models/access.py
return _config['password'] == CRYPT(digest_alg="sha512")(password)[0]

上記のdigest_algを指定してやればとりあえずhash関数は変えられます.
web2py直下にparameters_xxxx.py(xxxxはadmin画面へのログインのためのport番号)とかいうのおいて中にパスワードをhash化したデータ書いておけばよいのです.

web2py/parameters_65537.py
password="d8b9fda3db38bc4b6664f391210878e9f090a41396638a7fe902a7482445acd00f7876ada6f490866ed150016aa7e20556f0fe7ee000449dfbac5231d1c69f5d"

こんなファイルを作って設置しておきます.
(80とか443のadminへのアクセスはすべてBANして,65537 portへは特定のIPからのみアクセス可能にしておく,みたいな)
http://fqdn:65537/admin にアクセスすれば,ログイン画面出るので,パスワード入力してログインしますと幸せです.

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