This bash script will help you to update all servers if you have more then 2 ;) it is very handy

# A shell script to update all remote Redhat Enterprise Linux 5 / CentOS Linux 5 servers
# You must have ssh public and private key installed. This will save a lot of time if you
# have 5-7 servers. 
# an array to store all ssh commands
	"ssh -p222 yum update -y"
	"ssh -p333 yum update -y"
	"ssh yum update -y"
	"ssh user1@ -t sudo  '/usr/bin/yum update -y' "
# simply run array item
for c in "${hosts[@]}"