open**用户密码认证登陆
一、基于上一篇文章的密钥认证登陆,现在实现用户密码登陆(在上一篇的基础上修改即可)。
1、首先修改vi /etc/open**/server.conf配置文件,在这里注释五行密钥认证文件,添加以下四行用户密码认证文件:
1)auth-user-pass-verify /etc/open**/auth_pass.sh via-file 允许运行密码认证脚本
2)client-cert-not-required 不需要客户端证书认证
3)username-as-common-name 使用用户名密码登录认证
4)script-security 3 脚本安全性3
2、新建用户密码认证脚本 vi /etc/open**/auth_pass.sh
#!/bin/bash
#the username+password is stored in a temporary file
#pointed to by $1
username=head -1 $1
password=tail -1 $1
if grep "$username:$password" pass_file > /dev/null 2>&1
then
exit 0
else
if grep "$username" pass_file > /dev/null 2>&am