Skip to content

Instantly share code, notes, and snippets.

@idleuncle
Last active May 6, 2019 15:05
Show Gist options
  • Save idleuncle/35641192e0fed28cf452bf1033165ba4 to your computer and use it in GitHub Desktop.
Save idleuncle/35641192e0fed28cf452bf1033165ba4 to your computer and use it in GitHub Desktop.
自动非交互式从标准输入管道输入密码
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