How to solve key_read failed error in git push

I assigned a dedicated ssh key pair for github repos.
And I have associated the key pair with github correctly in ~/.ssh/config.
But each time when I try to access github repos via ssh, both read(such pull or fetch) or write(such as push), I will get a strange error:

key_read: uudecode [some SSH key code]
ssh-rsa [SSH key code]
failed

I tried a lot to fix the problem, and finally I solved the problem by delete the file ~/.ssh/known_hosts
I assume the problem might be caused that there is some invalid association cached in the file. So maybe you can solve the problem by removing the related entries instead of delete the whole file.

Distribute files to multiple servers via scp

The most common task when operating the servers is to distribute a file to multiple servers.
So I wrote a piece of shell script to solve this problem:

mscp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
echo "mscp <source file> <target dir>"
SourceFile=$1
TargetDir=$2
echo "Copy $SourceFile to $TargetDir as $RemoteUser"
echo "Enter the servers:"
if [-f $SourceFile ]
then
printf "File found, preparing to transfer\n"
while read server
do
scp -p $SourceFile ${server}:$TargetDir
done
else
printf "File \"$SourceFile\"not found\n"
exit 1
fi
exit 0

call the script mscp <source file> <target dir>, then the script will ask you the list of target servers. So you can type them one by one. If the remote user is different than you current user, you can also explicitly identify it by typeing user@server

Beside the previous scenario, there is a more common sceanrio, that you have got a server list stored in afile already. Then instead of type the servers line by line, you can pipe the file content to the script.
e.g:

Read server list from file
1
cat server_list.txt > mscp src_files dest_path