passwd --stdin 选项

--stdin
              This option is used to indicate that passwd should read the new password from standard input, which can be a pipe.

	     这个选项用于 从标准输入 管道读入新的密码
[root@master ~]# ssh 10.10.17.2 "echo 'a2p13mvh' | passwd --stdin root"
[email protected]'s password: 
Changing password for user root.
passwd: all authentication tokens updated successfully.



你可能感兴趣的:(zj-脚本)