2 Star 3 Fork 2

Janbar / sshdTwoVerification

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
janbar.qrencode.sh 458 Bytes
一键复制 编辑 原始数据 按行查看 历史
Janbar 提交于 2019-11-12 20:35 . add QRcode
#!/bin/bash
login=0
for i in $(seq 3); do
code=$(awk 'BEGIN{srand();c[0]=42;c[1]=43;printf("%d %c %d",int(10*rand())+1,c[int(2*rand())],int(10*rand())+1)}')
qrencode -t UTF8 -o - "$code = ?"
if ! read -t 60 -s -p 'Password: ' password ;then
exit 0
fi
echo
cmp_str=$(cat /etc/janbar)$((code))
if [ "${password,,}" = "${cmp_str,,}" ];then
login=1; break
fi
echo -e 'Login incorrect\n'
done
if [ $login -eq 1 ];then
/bin/bash
fi
C
1
https://gitee.com/janbar/sshdTwoVerification.git
git@gitee.com:janbar/sshdTwoVerification.git
janbar
sshdTwoVerification
sshdTwoVerification
master

搜索帮助