个人博客

记录一些日常

netflix-proxy 修改管理密码

项目地址

https://github.com/ab77/netflix-proxy

重置密码

官方提供的解决方法

https://github.com/ab77/netflix-proxy/wiki/Change-admin-password

cd /opt/netflix-proxy/auth
 ./admin-reset.sh

注意:/opt/netflix-proxy应为netflix-proxy项目的存放目录。但它可能位于服务器的/root目录下。因此,使用时,您需要修改为netflix-proxy项目位于您服务器的存放目录

但是报错

root@usa:~/netflix-proxy/auth# ./admin-reset.sh
Please enter a new admin password: 
~/netflix-proxy/auth ~/netflix-proxy/auth
Traceback (most recent call last):
File "/root/netflix-proxy/auth/pbkdf2_sha256_hash.py", line 4, in <module>
from passlib.hash import pbkdf2_sha256
ImportError: No module named passlib.hash
~/netflix-proxy/auth
rc=0

解决方法

我在这里找到了解决方法

https://github.com/ansible/ansible/issues/6776

命令如下

pip install paramiko PyYAML jinja2 httplib2 passlib

等待

root@usa:~/netflix-proxy/auth# pip install paramiko PyYAML jinja2 httplib2 passlib
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting paramiko
Downloading https://files.pythonhosted.org/packages/cf/ae/94e70d49044ccc234bfdba20114fa947d7ba6eb68a2e452d89b920e62227/paramiko-2.4.2-py2.py3-none-any.whl (193kB)
100% |████████████████████████████████| 194kB 10.3MB/s 
Collecting PyYAML
Downloading https://files.pythonhosted.org/packages/9f/2c/9417b5c774792634834e730932745bc09a7d36754ca00acf1ccd1ac2594d/PyYAML-5.1.tar.gz (274kB)
100% |████████████████████████████████| 276kB 12.6MB/s 
Collecting jinja2
Downloading https://files.pythonhosted.org/packages/1d/e7/fd8b501e7a6dfe492a433deb7b9d833d39ca74916fa8bc63dd1a4947a671/Jinja2-2.10.1-py2.py3-none-any.whl (124kB)
100% |████████████████████████████████| 133kB 21.9MB/s 
Collecting httplib2
Downloading https://files.pythonhosted.org/packages/75/d0/f213003c9deec99fb4f46e54580b93a3b121c487d9d6d888fc12267eb2a2/httplib2-0.12.1.tar.gz (218kB)
100% |████████████████████████████████| 225kB 21.9MB/s 
Collecting passlib
Using cached https://files.pythonhosted.org/packages/ee/a7/d6d238d927df355d4e4e000670342ca4705a72f0bf694027cf67d9bcf5af/passlib-1.7.1-py2.py3-none-any.whl
Requirement already satisfied: cryptography>=1.5 in /usr/lib/python2.7/dist-packages (from paramiko) (2.1.4)
Collecting pynacl>=1.0.1 (from paramiko)
Downloading https://files.pythonhosted.org/packages/b3/25/e605574f24948a8a53b497744e93f061eb1dbe7c44b6465fc1c172d591aa/PyNaCl-1.3.0-cp27-cp27mu-manylinux1_x86_64.whl (762kB)
100% |████████████████████████████████| 768kB 7.7MB/s 
Collecting pyasn1>=0.1.7 (from paramiko)
Downloading https://files.pythonhosted.org/packages/7b/7c/c9386b82a25115cccf1903441bba3cbadcfae7b678a20167347fa8ded34c/pyasn1-0.4.5-py2.py3-none-any.whl (73kB)
100% |████████████████████████████████| 81kB 22.0MB/s 
Collecting bcrypt>=3.1.3 (from paramiko)
Downloading https://files.pythonhosted.org/packages/50/d8/95f7cb04344033bf9d1a12c5a7969a15999b6a710fbe1969c517333d9a62/bcrypt-3.1.6-cp27-cp27mu-manylinux1_x86_64.whl (59kB)
100% |████████████████████████████████| 61kB 16.7MB/s 
Collecting MarkupSafe>=0.23 (from jinja2)
Downloading https://files.pythonhosted.org/packages/fb/40/f3adb7cf24a8012813c5edb20329eb22d5d8e2a0ecf73d21d6b85865da11/MarkupSafe-1.1.1-cp27-cp27mu-manylinux1_x86_64.whl
Requirement already satisfied: six in /usr/lib/python2.7/dist-packages (from pynacl>=1.0.1->paramiko) (1.11.0)
Collecting cffi>=1.4.1 (from pynacl>=1.0.1->paramiko)
Downloading https://files.pythonhosted.org/packages/9d/6f/aea9f5559fb593da07ff34e67513bd62483b45715b4a5f5fae6a0a5792ea/cffi-1.12.2-cp27-cp27mu-manylinux1_x86_64.whl (413kB)
100% |████████████████████████████████| 419kB 11.8MB/s 
Collecting pycparser (from cffi>=1.4.1->pynacl>=1.0.1->paramiko)
Downloading https://files.pythonhosted.org/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz (158kB)
100% |████████████████████████████████| 163kB 22.6MB/s 
Building wheels for collected packages: PyYAML, httplib2, pycparser
Building wheel for PyYAML (setup.py) ... done
Stored in directory: /root/.cache/pip/wheels/ad/56/bc/1522f864feb2a358ea6f1a92b4798d69ac783a28e80567a18b
Building wheel for httplib2 (setup.py) ... done
Stored in directory: /root/.cache/pip/wheels/98/82/0d/cfb126a5e40d487157e43fdb3332937713dde36b4d0e1e754d
Building wheel for pycparser (setup.py) ... done
Stored in directory: /root/.cache/pip/wheels/f2/9a/90/de94f8556265ddc9d9c8b271b0f63e57b26fb1d67a45564511
Successfully built PyYAML httplib2 pycparser
Installing collected packages: pycparser, cffi, pynacl, pyasn1, bcrypt, paramiko, PyYAML, MarkupSafe, jinja2, httplib2, passlib
Successfully installed MarkupSafe-1.1.1 PyYAML-5.1 bcrypt-3.1.6 cffi-1.12.2 httplib2-0.12.1 jinja2-2.10.1 paramiko-2.4.2 passlib-1.7.1 pyasn1-0.4.5 pycparser-2.19 pynacl-1.3.0

然后重试

root@usa:~/netflix-proxy/auth# ./admin-reset.sh
Please enter a new admin password: 
~/netflix-proxy/auth ~/netflix-proxy/auth
~/netflix-proxy/auth
rc=0

成功。

如果出现这样的情况

NameError: name 'platform_system' is not defined

《netflix-proxy 修改管理密码》
则需要先执行该命令

pip install --upgrade setuptools

发表评论

电子邮件地址不会被公开。 必填项已用*标注