git with ssh error: Permission denied (publickey,keyboard-interactive)

5,013

Well, actually, I've figured out what the problem is and solved it after all.

When I installed my copssh client, there was a step which asked me to choose user directory. I used my customized configuration, which was directory d:/Users/svccopssh/.ssh. However, the exact directory where svccopssh reads public-keys from is d:/copssh/home/svccopssh/.ssh, obviously not the directory I've used in my installation. After I changed my authorized_keys location to the right place: path/to/copssh_loaction/home/yourUserName/.ssh, it worked.

Share:
5,013

Related videos on Youtube

is_january
Author by

is_january

Updated on September 18, 2022

Comments

  • is_january
    is_january over 1 year

    I'm trying to build a git repo server with a windows remote. Here is my ssh server and local client building environment:

    Server env
    1. windows os
    2. mysysgit installed
    3. copssh installed
    4. remote cloud server

    client
    1. centOS 7 on vmware
    2. local pc

    Here is my already taken actions.

    1. generate a public-private key pair with ssh-keygen -t rsa on my centos client
    2. add a git user named svccopssh in my remote windows server
    3. copy my centos ~/.ssh/id_rsa.pub to the server folder d:/Users/svccopssh/.ssh, in which copssh reads public-ssh-key, and rename it as authorized_keys
    4. run test:
    ssh -vT svccopssh@remoteIP

    The result comes out like this:

    [is_january@localhost .ssh]$ ssh -vT [email protected]
    OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 56: Applying options for *
    debug1: Connecting to 120.76.123.231 [120.76.123.231] port 22.
    debug1: Connection established.
    debug1: identity file /home/is_january/.ssh/id_rsa type 1
    debug1: identity file /home/is_january/.ssh/id_rsa-cert type -1
    debug1: identity file /home/is_january/.ssh/id_dsa type -1
    debug1: identity file /home/is_january/.ssh/id_dsa-cert type -1
    debug1: identity file /home/is_january/.ssh/id_ecdsa type -1
    debug1: identity file /home/is_january/.ssh/id_ecdsa-cert type -1
    debug1: identity file /home/is_january/.ssh/id_ed25519 type -1
    debug1: identity file /home/is_january/.ssh/id_ed25519-cert type -1
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_6.6.1
    debug1: Remote protocol version 2.0, remote software version OpenSSH_7.1
    debug1: match: OpenSSH_7.1 pat OpenSSH* compat 0x04000000
    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: kex: [email protected] need=20 dh_need=20
    debug1: kex: [email protected] need=20 dh_need=20
    debug1: sending SSH2_MSG_KEX_ECDH_INIT
    debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
    debug1: Server host key: ECDS 26:95:35:2c:32:ad:46:14:94:5e:71:95:b7:f7:2d:aa
    debug1: Host '120.76.123.231' is known and matches the ECDSA host key.
    debug1: Found key in /home/is_january/.ssh/known_hosts:1
    debug1: ssh_ecdsa_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,keyboard-interactive
    debug1: Next authentication method: publickey
    debug1: Offering RSA public key: /home/is_january/.ssh/id_rsa
    debug1: Authentications that can continue: publickey,keyboard-interactive
    debug1: Trying private key: /home/is_january/.ssh/id_dsa
    debug1: Trying private key: /home/is_january/.ssh/id_ecdsa
    debug1: Trying private key: /home/is_january/.ssh/id_ed25519
    debug1: Next authentication method: keyboard-interactive
    debug1: Authentications that can continue: publickey,keyboard-interactive
    debug1: No more authentication methods to try.
    Permission denied (publickey,keyboard-interactive).
    

    Any suggestions ? I am sure that the same public-key works well on github ssh-key

    • Guillaume Boudreau
      Guillaume Boudreau over 7 years
      What about ssh -vvvT svccopssh@remoteIP? More -v = more verbose. Also try to check the server logs. You might see a problem with the authorized_keys file (permission problem or similar).
    • is_january
      is_january over 7 years
      @GuillaumeBoudreau That's right. It's the wrong location of authorized_key which results in the problem