From b40b7d7c6770fc3f1f39f9b7b576a88c1ce87864 Mon Sep 17 00:00:00 2001 From: Alex Yang Date: Sun, 8 Jan 2017 22:45:12 +0800 Subject: Simplify the steps in trustme.sh Change-Id: Ic7432bd78225ba4d598eef0f283957a34e6401de Signed-off-by: Alex Yang --- deploy/trustme.sh | 51 ++++++++------------------------------------------- 1 file changed, 8 insertions(+), 43 deletions(-) (limited to 'deploy') diff --git a/deploy/trustme.sh b/deploy/trustme.sh index 33b76546..a0414fd9 100755 --- a/deploy/trustme.sh +++ b/deploy/trustme.sh @@ -1,5 +1,5 @@ #!/bin/sh -#to be trusted by other host£¬and no password needed when use ssh command +#to be trusted by other host and no password needed when use ssh command #check parameters legality logfile=/var/log/trustme.log @@ -37,7 +37,7 @@ fi #generate ssh pubkey if [ ! -e ~/.ssh/id_dsa.pub ]; then print_log "generating ssh public key ..." - ssh-keygen -t dsa -f /root/.ssh/id_dsa -N "" <> ~/.ssh/authorized_keys" -if [ $? != 0 ]; then - print_log "ssh $ip to add public key for authorized_keys failed" - exit 1 -fi -print_log "rm tmp file $ip:$tmpfile" -sshpass -p $passwd ssh -o StrictHostKeyChecking=no $ip "rm $tmpfile" -if [ $? != 0 ]; then - print_log "ssh $ip to delete tmp file failed" + print_log "ssh-copy-id failed" exit 1 fi + print_log "trustme ok!" -- cgit 1.2.3-korg