An error occurred while logging in after ssh keygen.

Source: Internet
Author: User
Tags hmac ssh keygen

The ssh keygen logon is invalid. fixed the problem of setting logon without a password. The error is invalid. ssh-keygen, incorrect setting method: log on to the remote host: mkdir. ssh & chmod 700. ssh local: scp. ssh/id_rsa.pub root @ your_remote_host: the logon result still prompts you to enter the password .... ++ has tried it many times, and the permissions are completely correct... no... later, we found that the correct setting method was: log on to the remote host: mkdir. ssh & chmod 700. ssh local: ssh-copy-id-I. ssh/id_rsa.pub root @ your_remote_host OK ~~ When setting an error, ssh displays the debugging information: ssh-vvv-oPreferredAuthentications = publickey root @ your_remote_host. The debugging information for the error is as follows: Reference OpenSSH_5.2p1, OpenSSL 1.0.1c 10 May 2012 debug1: reading configuration data/usr/local/etc/ssh_config debug2: ssh_connect: needpriv 0 debug1: Connecting to 192.168.0.113 [192.168.0.113] port 22. debug1: Connection established. debug1: identity file ~ /. Ssh/identity type-1 debug3: Not a RSA1 key file/home/gototouch /. ssh/id_rsa. keys: unknown key type '----- BEGIN 'debug3: key_read: missing keytype debug3: key_read: missing whitespace usage: key_read: missing whitespace debug3: key_read: missing whitespace usage: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: Key_read: missing whitespace usage: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace Usage: key_read: missing whitespace usage: Usage: missing whitespace usage: key_read: missing whitespace debug3: key_read: missing whitespace debug2: key_type_from_name: unknown key type '----- END 'debug3: key_read: missing keytype debug1: identi Ty file ~ /. Ssh/id_rsa type 1 debug1: identity file ~ /. Ssh/id_dsa type-1 debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3 debug1: match: OpenSSH_5.3 pat OpenSSH * debug1: Enabling compatibility mode for protocol 2.0 debug1: local version string SSH-2.0-OpenSSH_5.2 debug2: fd 3 setting O_NONBLOCK debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT inclued debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256, diffi E-hellman-group-exchange-sha1, diffie-hellman-group14-sha1, diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa, ssh-dss debug2: aes128-ctr, aes192-ctr, aes256-ctr, arcfour256, arcfour128, aes128-cbc, 3des-cbc, blowfish-cbc, cast128-cbc, aes192-cbc, aes256-cbc, arcfour, rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: aes128-ctr, aes192-ctr, aes256-ctr, arcfour256, arcfour128, aes12 8-cbc, 3des-cbc, blowfish-cbc, cast128-cbc, aes192-cbc, aes256-cbc, arcfour, rijndael-cbc@lysator.liu.se debug2: hmac-md5, hmac-sha1, umac-64@openssh.com, hmac-ripemd160, hmac-ripemd160@openssh.com debug2: kex_parse_kexinit: hmac-sha1-96, hmac-sha1, umac-64@openssh.com, hmac-ripemd160, hmac-ripemd160@openssh.com, hmac-sha1-96, hmac-md5-96 debug2: kex_parse_kexinit: none, zlib @ Openssh.com, zlib debug2: Keys: none, zlib@openssh.com, zlib debug2: kex_parse_kexinit: debug2: Keys: debug2: Keys 0 debug2: Keys: reserved 0 debug2: Keys: diffie-hellman-group-exchange-sha256, diffie-hellman-group-exchange-sha1, diffie-hellman-group14-sha1, diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa, Ssh-dss debug2: kex_parse_kexinit: aes128-ctr, aes192-ctr, aes256-ctr, arcfour256, arcfour128, aes128-cbc, 3des-cbc, blowfish-cbc, cast128-cbc, aes192-cbc, arcfour, aes256-cbc debug2: rijndael-cbc@lysator.liu.se, aes192-ctr, aes256-ctr, arcfour256, arcfour128, aes128-cbc, 3des-cbc, blowfish-cbc, cast128-cbc, aes192-cbc, aes256-cbc, arcfour, rijndael-cbc@lysator.liu.se debug2: kex_parse_kexi Nit: hmac-md5, hmac-sha1, umac-64@openssh.com, hmac-ripemd160, hmac-ripemd160@openssh.com, hmac-sha1-96 debug2: kex_parse_kexinit: hmac-md5-96, hmac-md5, hmac-sha1, umac-64@openssh.com, hmac-ripemd160, hmac-ripemd160@openssh.com debug2: kex_parse_kexinit: none, zlib@openssh.com debug2: kex_parse_kexinit: none, zlib@openssh.com debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debu G2: Counter 0 debug2: kex_parse_kexinit: reserved 0 debug2: mac_setup: found hmac-md5 debug1: kex: server-> client aes128-ctr hmac-md5 none debug2: mac_setup: found hmac-md5 debug1: kex: client-> server aes128-ctr hmac-md5 none debug1: SSH2_MSG_KEX_DH_GEX_REQUEST (1024 <1024 <8192) sent debug1: expecting includebug2: dh_gen_key: priv key bits set: 121/2 56 debug2: bits set: 499/1024 debug1: SSH2_MSG_KEX_DH_GEX_INIT sent debug1: expecting includebug3: check_host_in_hostfile: filename/home/gototouch /. ssh/known_hosts debug3: check_host_in_hostfile: match line 6 debug1: host' 192. 168.0.113 'is known and matches the RSA host key. debug1: Found key in ~ /. Ssh/known_hosts: 6 debug2: bits set: 522/1024 debug1: signature correct debug2: includebug2: set_newkeys: mode 1 debug1: inclusent debug1: expecting includebug2: signature: mode 0 debug1: SSH2_MSG_NEWKEYS inclued debug1: SSH2_MSG_SERVICE_REQUEST sent debug2: service_accept: ssh-userauth debug1: SSH2_MSG_SERVICE_ACCEPT inclued debug2: key :~ /. Ssh/id_rsa (0x15fce10) debug2: key: ubuntuhost@gmail.com (0x1604210) debug2: key :~ /. Ssh/identity (nil) debug2: key :~ /. Ssh/id_dsa (nil) debug1: Authentications that can continue: publickey, gssapi-keyex, gssapi-with-mic, password debug3: start over, passed a different list publickey, gssapi-keyex, gssapi-with-mic, password debug3: preferred publickey debug3: inclupublickey debug3: remaining preferred: Signature: inclupublickey identifier: Next authentication method: publickey debug1: Offering p Ublic key :~ /. Ssh/id_rsa debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug1: Authentications that can continue: publickey, gssapi-keyex, gssapi-with-mic, password debug1: offering public key: ubuntuhost@gmail.com debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug1: Authentications that can continue: publickey, gssapi-keyex, gssapi-with-mic, password debu G1: Trying private key :~ /. Ssh/identity debug3: no such identity :~ /. Ssh/identity debug1: Trying private key :~ /. Ssh/id_dsa debug3: no such identity :~ /. Ssh/id_dsa debug2: we did not send a packet, disable method debug1: No more authentication methods to try. permission denied (publickey, gssapi-keyex, gssapi-with-mic, password ). note: I carefully read the steps of/usr/bin/ssh-copy-id and found the role of the centos restorecon command, the following method can be used to log on without a password: Remote Execution: mkdir. ssh & chmod 700. local ssh execution: cat ~ /. Ssh/id_rsa.pub | ssh root @ your_host 'cat->. ssh/authorized_keys 'Remote Execution: restorecon. ssh. ssh/authorized_keys the last step is a guarantee of success.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.