create new SSH key-pair
Started to login and be banned/blocked every time. Would clear iptables, hosts.deny each time. Did not seem to be caused by Fail2Ban or OSSEC.
Though to start key-pair over again.
Has not worked. What am I missing?
On the Linode.
$ ls -alF .ssh
drwx------ 2 davida davida 4096 Feb 1 16:46 ./
drwx------ 11 davida davida 4096 Feb 1 16:46 ../
-rw------- 1 davida davida 741 Feb 1 16:46 authorized_keys
On local computer:
$ ssh-keygen -f "/home/david/.ssh/known_hosts" -R IP address
$ ssh-copy-id davida@IPaddress
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed – if you are prompted now it is to install the new keys
davida@IPaddress's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'davida@IP address'"
and check to make sure that only the key(s) you wanted were added.
$ ssh -vvv davida@ IP address
OpenSSH_6.7p1 Debian-5+deb8u3, OpenSSL 1.0.1t 3 May 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to "IP address" port 22.
debug1: Connection established.
debug1: identity file /home/david/.ssh/id_rsa type 1
debug1: keyloadpublic: No such file or directory
debug1: identity file /home/david/.ssh/id_rsa-cert type -1
debug1: keyloadpublic: No such file or directory
debug1: identity file /home/david/.ssh/id_dsa type -1
debug1: keyloadpublic: No such file or directory
debug1: identity file /home/david/.ssh/id_dsa-cert type -1
debug1: keyloadpublic: No such file or directory
debug1: identity file /home/david/.ssh/id_ecdsa type -1
debug1: keyloadpublic: No such file or directory
debug1: identity file /home/david/.ssh/id_ecdsa-cert type -1
debug1: keyloadpublic: No such file or directory
debug1: identity file /home/david/.ssh/id_ed25519 type -1
debug1: keyloadpublic: No such file or directory
debug1: identity file /home/david/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.7p1 Debian-5+deb8u3
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
debug1: match: OpenSSH6.6.1 pat OpenSSH6.6.1* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug3: loadhostkeys: loading entries for host "IP address" from file "/home/david/.ssh/knownhosts"
debug3: loadhostkeys: found key type ECDSA in file /home/david/.ssh/knownhosts:53
debug3: load_hostkeys: loaded 1 keys
debug3: order_hostkeyalgs: prefer hostkeyalgs:
debug1: SSH2MSGKEXINIT sent
debug1: SSH2MSGKEXINIT received
debug2: kexparsekexinit:
debug2: kexparsekexinit:
debug2: kexparsekexinit: aes128-ctr,aes192-ctr,aes256-ctr,
debug2: kexparsekexinit: aes128-ctr,aes192-ctr,aes256-ctr,
debug2: kexparsekexinit:
debug2: kexparsekexinit:
debug2: kexparsekexinit: none,
debug2: kexparsekexinit: none,
debug2: kexparsekexinit:
debug2: kexparsekexinit:
debug2: kexparsekexinit: firstkexfollows 0
debug2: kexparsekexinit: reserved 0
debug2: kexparsekexinit:
debug2: kexparsekexinit: ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519
debug2: kexparsekexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,
debug2: kexparsekexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,
debug2: kexparsekexinit:
debug2: kexparsekexinit:
debug2: kexparsekexinit: none,
debug2: kexparsekexinit: none,
debug2: kexparsekexinit:
debug2: kexparsekexinit:
debug2: kexparsekexinit: firstkexfollows 0
debug2: kexparsekexinit: reserved 0
debug2: mac_setup: setup
debug1: kex: server->client aes128-ctr
debug2: mac_setup: setup
debug1: kex: client->server aes128-ctr
debug1: sending SSH2MSGKEXECDHINIT
debug1: expecting SSH2MSGKEXECDHREPLY
debug1: Server host key: ECDSA d1:e2:0a:ef:80:4f:79:78:4b:06:c3:80:ad:78:6a:bf
debug3: loadhostkeys: loading entries for host "IP address" from file "/home/david/.ssh/knownhosts"
debug3: loadhostkeys: found key type ECDSA in file /home/david/.ssh/knownhosts:53
debug3: load_hostkeys: loaded 1 keys
debug1: Host 'IP address' is known and matches the ECDSA host key.
debug1: Found key in /home/david/.ssh/known_hosts:53
debug2: kexderivekeys
debug2: set_newkeys: mode 1
debug1: SSH2MSGNEWKEYS sent
debug1: expecting SSH2MSGNEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2MSGNEWKEYS received
debug1: SSH2MSGSERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2MSGSERVICE_ACCEPT received
debug2: key: /home/david/.ssh/id_rsa (0x7fce4256c530),
debug2: key: /home/david/.ssh/id_dsa ((nil)),
debug2: key: /home/david/.ssh/id_ecdsa ((nil)),
debug2: key: /home/david/.ssh/id_ed25519 ((nil)),
debug1: Authentications that can continue: publickey
debug3: start over, passed a different list publickey
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethodisenabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/david/.ssh/id_rsa
debug3: sendpubkeytest
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 535
debug2: inputuserauthpk_ok: fp 93:09:88:90:0a:fe:1c:2c:05:42:9c:12:8c:02:dd:dd
debug3: signandsend_pubkey: RSA 93:09:88:90:0a:fe:1c:2c:05:42:9c:12:8c:02:dd:dd
Agent admitted failure to sign using the key.
debug1: Trying private key: /home/david/.ssh/id_dsa
debug3: no such identity: /home/david/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /home/david/.ssh/id_ecdsa
debug3: no such identity: /home/david/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /home/david/.ssh/id_ed25519
debug3: no such identity: /home/david/.ssh/id_ed25519: No such file or directory
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).
3 Replies
Local is Debian 8.5.
[Wed Feb 01 19:26:45 david@ASUS-U56E:~ ] $ SSHAUTHSOCK=0 ssh -v davida@IPaddress
OpenSSH_6.7p1 Debian-5+deb8u3, OpenSSL 1.0.1t 3 May 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to IPaddress port 22.
debug1: Connection established.
debug1: identity file /home/david/.ssh/id_rsa type 1
debug1: keyloadpublic: No such file or directory
debug1: identity file /home/david/.ssh/id_rsa-cert type -1
debug1: keyloadpublic: No such file or directory
debug1: identity file /home/david/.ssh/id_dsa type -1
debug1: keyloadpublic: No such file or directory
debug1: identity file /home/david/.ssh/id_dsa-cert type -1
debug1: keyloadpublic: No such file or directory
debug1: identity file /home/david/.ssh/id_ecdsa type -1
debug1: keyloadpublic: No such file or directory
debug1: identity file /home/david/.ssh/id_ecdsa-cert type -1
debug1: keyloadpublic: No such file or directory
debug1: identity file /home/david/.ssh/id_ed25519 type -1
debug1: keyloadpublic: No such file or directory
debug1: identity file /home/david/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.7p1 Debian-5+deb8u3
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
debug1: match: OpenSSH6.6.1 pat OpenSSH6.6.1* compat 0x04000000
debug1: SSH2MSGKEXINIT sent
debug1: SSH2MSGKEXINIT received
debug1: kex: server->client aes128-ctr
debug1: kex: client->server aes128-ctr
debug1: sending SSH2MSGKEXECDHINIT
debug1: expecting SSH2MSGKEXECDHREPLY
debug1: Server host key: ECDSA d1:e2:0a:ef:80:4f:79:78:4b:06:c3:80:ad:78:6a:bf
debug1: Host 'IPaddress' is known and matches the ECDSA host key.
debug1: Found key in /home/david/.ssh/known_hosts:53
debug1: SSH2MSGNEWKEYS sent
debug1: expecting SSH2MSGNEWKEYS
debug1: SSH2MSGNEWKEYS received
debug1: SSH2MSGSERVICE_REQUEST sent
debug1: SSH2MSGSERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/david/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 535
debug1: keyloadprivate_type: incorrect passphrase supplied to decrypt private key
Enter passphrase for key '/home/david/.ssh/id_rsa':
debug1: Authentication succeeded (publickey).
Authenticated to (IPaddress:22).
debug1: channel 0: new [client-session]
debug1: Requesting
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
Last login: Wed Feb 1 14:16:46 2017
LISH: Enabled SSH password login.
Local: Ran ssh-copy-id.
LISH: Disabled SSH password login.
SSH Local: key-pair working again.
Where to looks for a cause? Not /var/log/messages. Not OSSEC.