htpasswd -b -c site_pass username password
yum install httpd
#! /usr/bin/perl -w
#filename: add_ftp_user.pl
use strict;
#
print "#example: user:passwd\n";
while (<STDIN>) {
exit if ($_ =~/^\n/);
chomp;
(my $user, my $pass) = split /:/, $_, 2;
my $crypt = crypt $pass, '$1$' . gensalt(8);
print "$user:$crypt\n";
}
sub gensalt {
my $count = shift;
my @salt = ('.', '/', 0 .. 9, 'A' .. 'Z', 'a' .. 'z');
my $s;
$s .= $salt[rand @salt] for (1 .. $count);
return $s;
}
chmod o+x add_user.pl
./add_user.pl user:password
server
{
listen 80;
server_name www.1sucai.cn jb51.net;
root /www/jb51.net;
index index.html index.htm index.php;
auth_basic "input you user name and password";
auth_basic_user_file /usr/local/nginx/conf/vhost/nginx_passwd;
location ~ .php$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ /\.ht
{
deny all;
}
access_log /logs/jb51.net_access.log main;
}
server
{
listen 80;
server_name www.1sucai.cn jb51.net;
root /www/jb51.net;
index index.html index.htm index.php;
location ~ ^/admin/.*
{
location ~ \.php$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
auth_basic "auth";
auth_basic_user_file /usr/local/nginx/conf/vhost/auth/admin.pass;
}
location ~ .php$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ /\.ht
{
deny all;
}
access_log /logs/jb51.net_access.log main;
}
# /usr/local/apache/bin/htpasswd -bc linuxeye_pd linuxeye_user linuxeye_password Adding password for user linuxeye_user # cat linuxeye_pd linuxeye_user:$apr1$Mugpp3FE$zGsi7/JfQIhFXPlgqo/Wx/
# /usr/local/apache/bin/htpasswd -b linuxeye_pd linuxeye.com linuxeye.com Adding password for user linuxeye.com # cat linuxeye_pd linuxeye_user:$apr1$Mugpp3FE$zGsi7/JfQIhFXPlgqo/Wx/ linuxeye.com:$apr1$/8EUOPYI$4MBxYpzotrSDcTTDZvTeT0
# /usr/local/apache/bin/htpasswd -n linuxeye New password: Re-type new password: linuxeye:$apr1$bZ6Gclc4$zKRap.0BADzZIxLoxpDNv0 # /usr/local/apache/bin/htpasswd -nb linuxeye linuxeye_password linuxeye:$apr1$yvngdKGV$QrnlriJ.MxIu52Vmo.ROE1
# /usr/local/apache/bin/htpasswd -D linuxeye_pd linuxeye_user Deleting password for user linuxeye_user # cat linuxeye_pd linuxeye.com:$apr1$/8EUOPYI$4MBxYpzotrSDcTTDZvTeT0
# /usr/local/apache/bin/htpasswd -D linuxeye_pd linuxeye.com Deleting password for user linuxeye.com # /usr/local/apache/bin/htpasswd -b linuxeye_pd linuxeye.com linuxeye_passwd Adding password for user linuxeye.com # cat linuxeye_pd linuxeye.com:$apr1$74ZvB1vC$/b7ETmg8xhDPieYj0b0cE.
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有