使用以下命令代替ssh-copy-id: cat ~/.ssh/id_dsa.pub | ssh hadoop@slave "umask 077; mkdir -p .ssh ; cat >> .ssh/authorized_keys"