管理用户sudo htpasswd -d /etc/sockd.passwd 用户名 #添加或更新用户信息
sudo htpasswd -D /etc/sockd.passwd 用户名 #删除用户信息
如果系统中没有安装htpasswd,也可以用下面的perl脚本进行管理。
根据实际情况修改下面两个参数
my $htpasswdfile = /usr/local/etc/sockd.passwd; #密码文件保存的位置
my $algorithm = 1; #加密算法,1为MD5,安全性较低,如果pam-pwdfile的版本较高,可以改为5(SHA-256)或6(SHA-512)
sudo vi /usr/local/bin/sdpasswd
输入:#!/usr/bin/env perl
# This file is part of danted PAM.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
use warnings;
use strict;
use File::Copy;
my $htpasswdfile = "/usr/local/etc/sockd.passwd";
my $al