ssh-copy-id não está funcionando no Mac

0

Estou seguindo este tutorial e é isso que estou tentando

ssh-copy-id -i ~/.ssh/id_rsa.pub remote_host

Diz Permission denied (publickey,password).

Eu também tentei ssh -v remote_host e verifiquei que

debug1: Reading configuration data /Users/praful/.ssh/config
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to remote_host port 22.
debug1: Connection established.
debug1: identity file /Users/praful/.ssh/id_rsa type 1
debug1: identity file /Users/praful/.ssh/id_rsa-cert type -1
debug1: identity file /Users/praful/.ssh/id_dsa type -1
debug1: identity file /Users/praful/.ssh/id_dsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.1
debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.1 pat OpenSSH*
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr [email protected] none
debug1: kex: client->server aes128-ctr [email protected] none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<2048<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA 55:60:e4:78:c8:98:09:d2:0f:d3:69:73:b9:e0:99:60
debug1: Host is known and matches the RSA host key.
debug1: Found key in /Users/praful/.ssh/known_hosts:63
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/praful/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /Users/praful/.ssh/id_dsa
debug1: Next authentication method: password
root@remote_host's password:
    
por PythonEnthusiast 24.03.2017 / 12:57

1 resposta

0

Você deve fornecer a chave privada para ssh-copy-id ou nenhuma chave, como mencionado na sinopse do comando (da página de manual):

 ssh-copy-id [...] [-i [identity_file]] [-p port] [-o ssh_option] [user@]hostname

ou nenhuma chave (copiará todas as chaves na localização padrão nesse caso). Usando o seguinte deve fazer o trabalho:

ssh-copy-id -i ~/.ssh/id_rsa remote_host

Se não for útil, por favor, execute

ssh-copy-id -i ~/.ssh/id_rsa -o LogLevel=DEBUG3 remote_host

e atualize a pergunta com a saída para investigar mais.

    
por 24.03.2017 / 18:54