Last active
May 6, 2019 15:05
-
-
Save idleuncle/35641192e0fed28cf452bf1033165ba4 to your computer and use it in GitHub Desktop.
自动非交互式从标准输入管道输入密码
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh 192.168.1.1 "echo 'newpassword' | passwd --stdin root" | |
Ubuntu下没有--stdin选项,此时用chpasswd | |
echo user:newpassword | chpasswd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment