jenkins - can't ssh to remote server (key - permission denied) but works from cli

前端 未结 5 1259
孤独总比滥情好
孤独总比滥情好 2021-01-06 12:40

I have Jenkins running on my local machine trying to figure out remote ssh problem I\'m having on a server. I\'m getting this permission denied error which indicates a probl

5条回答
  •  既然无缘
    2021-01-06 13:20

    Multiple reasons could cause this behavior, like key caching with agent / keychain manager, etc.

    I would suggest to use the -v argument to compare the 2 outputs:

    ssh -v -i /Users/jgoodwin/.ssh/id_rsa remoteuser@server
    

    This will let you compare what is going in in a more verbose way. If you still cannot solve it, please post your verbose outputs to compare.

    Note: you can add up to 3 -v arguments for increased verbosity.

    Updated:

    @JasonG From what I see the details of the failure are:

    debug1: Offering RSA public key: /Users/jgoodwin/.ssh/id_rsa debug1: Server accepts key: pkalg ssh-rsa blen 279 debug1: key_parse_private_pem: PEM_read_PrivateKey failed debug1: read PEM private key done: type debug1: read_passphrase: can't open /dev/tty: Device not configured

    It looks like your key has a passphrase and the passphrase cannot be entered because we are not in an interactive shell. The command line from your standard shell may benefit from the Keycahin which would 'type the passphrase' for you.

    If you could generate the same verbosity for your successful command so that we could compare...

提交回复
热议问题