脚本Kerberos Ktutil制作密钥表 [英] Script Kerberos Ktutil to make keytabs

查看:781
本文介绍了脚本Kerberos Ktutil制作密钥表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想制作一个使用ktutil生成密钥表的脚本.运行脚本时我要使用 [user] $ script.sh密码

I want to make a script that will generate the a keytab using ktutil. When running the script I want to use [user]$ script.sh PASSWORD

#script.sh
echo "addent -password -p PRINCIPAL -k 1 -e aes256-cts-hmac-sha1-96" | ktutil

Ktutil比需要一个密码,这里我要使用上面的PASSWORD参数.我将如何通过密码辩论?

Ktutil than needs a password, here I want to use the PASSWORD argument from above. How would I pass the password arguement?

推荐答案

使用GNU bash:

With GNU bash:

user="PRINCIPAL"
pass="topsecret"

printf "%b" "addent -password -p $user -k 1 -e aes256-cts-hmac-sha1-96\n$pass\nwrite_kt $user.keytab" | ktutil

printf "%b" "read_kt $user.keytab\nlist" | ktutil

输出:


slot KVNO Principal
---- ---- ---------------------------------------------------------------------
   1    1                          PRINCIPAL@YOURDOMAIN

这篇关于脚本Kerberos Ktutil制作密钥表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆