Home | 简体中文 | 繁体中文 | 杂文 | Github | 知乎专栏 | 51CTO学院 | CSDN程序员研修院 | OSChina 博客 | 腾讯云社区 | 阿里云栖社区 | Facebook | Linkedin | Youtube | 打赏(Donations) | About
知乎专栏多维度架构

164.4. 第三方工具

164.4.1. htpasswd

$ sudo apt-get install apache2-utils
		

164.4.1.1. CRYPT

neo@master:~$ htpasswd -d -n neo.chen
New password:
Re-type new password:
neo.chen:Tyr60pyBFo0ng

			

164.4.1.2. MD5

neo@master:~$ htpasswd -m -n neo.chen
New password:
Re-type new password:
neo.chen:$apr1$CbZkN...$QzT7LwjRpQCKr4IkryM3Z.

			

164.4.1.3. SHA

neo@master:~$ htpasswd -s -n neo.chen
New password:
Re-type new password:
neo.chen:{SHA}iol5jPCHjje7ZYmuHDa52KA2J1s=
			

164.4.2. htdigest

htdigest 與 htpasswd 不同的地方在於對密碼的加密方式,htdigest 是使用 md5 來加密而 htpasswd 則是使用 crypt 來加密

htdigest -c /home/neo/trac/conf/passwd.digest localhost netkiller
htdigest /home/neo/trac/conf/passwd.digest localhost neo
		

164.4.3. md5sum

$ md5sum /etc/passwd
325b7229c82c90c8a1823f5d939156bc  /etc/passwd
		

164.4.4. sha1sum

$ sha1sum /etc/passwd
f7a5582dd42ce0411bc2c59e2f1d8e89adcf0f81  /etc/passwd