[SOLVED]SSH Key-Permission Denied

Discussion in 'macOS' started by crazystar, Oct 26, 2010.

  1. crazystar macrumors newbie

    Joined:
    Apr 30, 2009
    #1
    I did a clean 10.6 install and forgot to backup the ssh key. Now when I try to ssh into the server i get this:

    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added 'macpro,10.0.1.20' (RSA) to the list of known hosts.
    debug2: bits set: 522/1024
    debug1: ssh_rsa_verify: signature correct
    debug2: kex_derive_keys
    debug2: set_newkeys: mode 1
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug2: set_newkeys: mode 0
    debug1: SSH2_MSG_NEWKEYS received
    debug1: SSH2_MSG_SERVICE_REQUEST sent
    debug2: service_accept: ssh-userauth
    debug1: SSH2_MSG_SERVICE_ACCEPT received
    debug2: key: /Users/xxxxx/.ssh/identity (0x0)
    debug2: key: /Users/xxxxx/.ssh/id_rsa (0x0)
    debug2: key: /Users/xxxxx/.ssh/id_dsa (0x0)
    debug1: Authentications that can continue: publickey,keyboard-interactive
    debug3: start over, passed a different list publickey,keyboard-interactive
    debug3: preferred publickey,keyboard-interactive,password
    debug3: authmethod_lookup publickey
    debug3: remaining preferred: keyboard-interactive,password
    debug3: authmethod_is_enabled publickey
    debug1: Next authentication method: publickey
    debug1: Trying private key: /Users/xxxxx/.ssh/identity
    debug3: no such identity: /Users/xxxxx/.ssh/identity
    debug1: Trying private key: /Users/xxxxx/.ssh/id_rsa
    debug3: no such identity: /Users/xxxxx/.ssh/id_rsa
    debug1: Trying private key: /Users/xxxxx/.ssh/id_dsa
    debug3: no such identity: /Users/xxxxx/.ssh/id_dsa
    debug2: we did not send a packet, disable method
    debug3: authmethod_lookup keyboard-interactive
    debug3: remaining preferred: password
    debug3: authmethod_is_enabled keyboard-interactive
    debug1: Next authentication method: keyboard-interactive
    debug2: userauth_kbdint
    debug2: we sent a keyboard-interactive packet, wait for reply
    debug1: Authentications that can continue: publickey,keyboard-interactive
    debug3: userauth_kbdint: disable: no info_req_seen
    debug2: we did not send a packet, disable method
    debug1: No more authentication methods to try.
    Permission denied (publickey,keyboard-interactive).



    How can I fix this?

    Thanks

    Update: I have deleted ".ssh" folders on both the machine. Now what?
     
  2. dyn macrumors 68030

    Joined:
    Aug 8, 2009
    Location:
    .nl
    #2
    As you can tell from the debug info it can not find the keys which is obvious since they're gone. Without a backup you're lost. You need to start from scratch regarding the keys: create new keys and put them on the server. This time backup those freshly made keys straight away!
     
  3. crazystar thread starter macrumors newbie

    Joined:
    Apr 30, 2009
    #3
    Yes, I have learned from my mistake. I have generated new ssh keys, but it is not even allowing me to scp the new key. What do I need to do?

    ssh xxxx$ scp id_rsa.pub xxxx@macpro:/.ssh/
    Permission denied (publickey,keyboard-interactive).
    lost connection
     
  4. crazystar thread starter macrumors newbie

    Joined:
    Apr 30, 2009
    #4
    So I Fixed it, I logged into the server, copied the id_rsa.pub to .ssh folder, renamed it authorized_keys. Now I can ssh into the server.

    Thanks for the help.
     

Share This Page