ubuntu - key_load_public: invalid format after ssh-keygen -


after updating ubuntu 16.04 i've problem ssh connection, connection require password though public key copied in remote authorized_keys ssh-copy-id. after new ssh-copy-id receive key_load_public: invalid format, sure of correct key format i've generated new key ssh-keygen , re-launch ssh-copy-id result same key_load_public: invalid format, same ssh connection in have type password. how can generate key , copy on remote server without receive invalid format error?

ssh -v <user>@<host-name> :

openssh_7.2p2 ubuntu-4ubuntu2.1, openssl 1.0.2g 1 mar 2016 debug1: reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: applying options * debug1: /etc/ssh/ssh_config line 57: deprecated option "useroaming" debug1: connecting <host-name> [<ip>] port 22. debug1: connection established. debug1: key_load_public: no such file or directory debug1: identity file /home/<user>/.ssh/id_rsa type -1 debug1: key_load_public: no such file or directory debug1: identity file /home/<user>/.ssh/id_rsa-cert type -1 debug1: key_load_public: no such file or directory debug1: identity file /home/<user>/.ssh/id_dsa type -1 debug1: key_load_public: no such file or directory debug1: identity file /home/<user>/.ssh/id_dsa-cert type -1 debug1: key_load_public: no such file or directory debug1: identity file /home/<user>/.ssh/id_ecdsa type -1 debug1: key_load_public: no such file or directory debug1: identity file /home/<user>/.ssh/id_ecdsa-cert type -1 debug1: key_load_public: no such file or directory debug1: identity file /home/<user>/.ssh/id_ed25519 type -1 debug1: key_load_public: no such file or directory debug1: identity file /home/<user>/.ssh/id_ed25519-cert type -1 debug1: enabling compatibility mode protocol 2.0 debug1: local version string ssh-2.0-openssh_7.2p2 ubuntu-4ubuntu2.1 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* compat 0x04000000 debug1: authenticating <my_host>:22 '<user>' debug1: ssh2_msg_kexinit sent debug1: ssh2_msg_kexinit received debug1: kex: algorithm: curve25519-sha256@libssh.org debug1: kex: host key algorithm: ecdsa-sha2-nistp256 debug1: kex: server->client cipher: chacha20-poly1305@openssh.com mac: <implicit> compression: none debug1: kex: client->server cipher: chacha20-poly1305@openssh.com mac: <implicit> compression: none debug1: expecting ssh2_msg_kex_ecdh_reply debug1: server host key: ecdsa-sha2-nistp256 sha256:2xmttbzpu31c8ofzcyzmpsps9he0vaspa7rlikrx5aa authenticity of host '<host-name> (<ip>)' can't established. ecdsa key fingerprint sha256:2xmttbzpu31c8ofzcyzmpsps9he0vaspa7rlikrx5aa.

use ssh-keygen command generate key in remote machine then

cd ~/.ssh 

generate sshkey in remote machine , copy .pub file authorized keys , execute following command that

cat <key>.pub >> authorized_keys 

copy other key file(private key) machine , using can login. use following command that

ssh -i <key-file> <username>@<ip> 

if want implement ssh connection without of key file every time add generated .pub file in machine ~/.ssh/authorized_keys of remote machine can login giving ip or hostname


Comments

Popular posts from this blog

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

android - ConstraintLayout: Realign baseline constraint in case if dependent view visibility was set to GONE -

c# - Populating Gridview inside Listview ItemTemplate On Web User Control from Code Behind -