通过脚本更改AIX密码? [英] Changing an AIX password via script?
问题描述
我正在尝试通过脚本更改用户密码.我不能使用sudo,因为有一项功能要求用户在另一个用户更改其密码时再次更改密码.
I am trying to change a password of a user via script. I cannot use sudo as there is a feature that requires the user to change the password again if another user changes their password.
AIX正在系统上运行.
AIX is running on the system.
不幸的是,chpasswd不可用.
unfortunately, chpasswd is unavailable.
我期望已经安装了,但是我也遇到了麻烦.
I have expected installed, but I am having trouble with that also.
这是我认为可以的
echo "oldpassword\nnewpasswd123\nnewpasswd123" | passwd user
但是,一旦运行脚本,就会提示我please enter user's old password
他们不应该都被呼应吗?
However once run the script I am prompted with please enter user's old password
shouldn't they all be echoed in?
我是使用shell脚本的初学者,对此感到困惑.
I am a beginner with shell scripting and this has been baffled.
推荐答案
您可以尝试:
echo "USERNAME:NEWPASSWORD" | chpasswd
这篇关于通过脚本更改AIX密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!