通过脚本更改 AIX 密码? [英] Changing an AIX password via script?

查看:15
本文介绍了通过脚本更改 AIX 密码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过脚本更改用户的密码.我不能使用 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
newpasswd123
newpasswd123" | 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.

推荐答案

你可以试试:

回显用户名:新密码"|chpasswd

这篇关于通过脚本更改 AIX 密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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