htpasswd命令

实例1: 创建一个新的文件,并设置密码和用户,交互式 [root@test ~]# htpasswd -c /tmp/htpasswd linux New password: Re-type new password: Adding password for user linux [root@test ~]# cat /tmp/htpasswd linux:$apr1$3VhLd1HR$uSkhBgwIGYFDY5lWzZZsM0
实例2: 添加一个新用户到配置文件中,非交互式创建密码 [root@test ~]# htpasswd -b /tmp/htpasswd baodian 321 Adding password for user baodian [root@test ~]# cat /tmp/htpasswd linux:$apr1$3VhLd1HR$uSkhBgwIGYFDY5lWzZZsM0 baodian:$apr1$ApIm66k6$CpqxwyqMUq.ZbcmMVELu10
实例3: 删除一个指定的用户
[root@test ~]# htpasswd -D /tmp/htpasswd linux Deleting password for user linux [root@test ~]# cat /tmp/htpasswd baodian:$apr1$ApIm66k6$CpqxwyqMUq.ZbcmMVELu10

展开阅读剩余部分