Created
April 27, 2016 07:20
-
-
Save bigwheel/5e7d26b886303ae1f82d0287b63ba371 to your computer and use it in GitHub Desktop.
暫定的にパスワードを振られたアカウントを多数受領したときに、一括で自分のパスワードへ変える方法(ttyが有効になっていてsudo権限がありsshpassがインストールされている前提)
This file contains hidden or 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
#!/usr/bin/env bash | |
set -ex | |
ip_list=() | |
ip_list+=("192.168.1.1") | |
ip_list+=("192.168.1.2") | |
ip_list+=("192.168.1.3") | |
ip_list+=("192.168.1.4") | |
for i in "${ip_list[@]}" | |
do | |
echo "<<ここに自分のパスワードを書く>>" | sshpass -p kbigwheel ssh $i -l kbigwheel -o 'StrictHostKeyChecking no' sudo passwd --stdin kbigwheel | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment