简体   繁体   中英

SSHD is asking for a passphrase for my key whereas there is no passphrase

A lot of topics seems to be related to my issue. But none of them solved my problem:

I have copied my SSH private key to a new server. I have never set a passphrase for it. But now when I try to connect to Gitlab (from my server) it asks for a password.

ssh -v -i /home/john/.ssh/id_rsa git@gitlab.com
[...]
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/john/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: key_parse_private2: missing begin marker
debug1: key_parse_private_pem: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
Enter passphrase for key '/home/john/.ssh/id_rsa': 

If I create a brand new pair of keys. It perfectly works! But I want to keep my current key. On the client side, the rights are good: - .ssh -> 700 - id_rsa -> 600

I am running a fresh Centos 7.3.

Your private key is presumably not in the exact format that SSH requires. Make sure that it begins with -----BEGIN RSA PRIVATE KEY----- and ends with -----END RSA PRIVATE KEY----- exactly .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM