[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ssh doesn't work.



Thank you for the quick response, Henning.

2016-12-08 1:07 GMT+09:00 Henning Follmann <hfollmann@itcfollmann.com>:
> Please revert to your original configs. Key login works be default and
> requires no change.

By reverting to my original configs :
PasswordAuthentication yes
I was able to ssh.

$ ssh -p 9999 testac@192.168.0.5
testac@192.168.0.5's password:
Last login: Thu Dec  8 10:56:31 2016 from 192.168.0.3

>
> first generate a key:
> ssh-keygen
>
> By default it creats both id_rsa and id_rsa.pub in your ~/.ssh directory.
> id_rsa contains the private key and it should remain on the client machine
> in your ~/.ssh directory.

I already did as the debug output in my last email showed.

> Transfer the id_rsa.pub to the server you want to logon to.there append it
> to
> cat id_rsa.pub >> <homedirectory of user>/.ssh/authorized_keys
>

Sorry. I forgot writing about having done this.

> debug1: Authentications that can continue: publickey,keyboard-interactive
> debug1: Trying private key: /home/emmm/.ssh/id_rsa
> debug1: Trying private key: /home/emmm/.ssh/id_dsa
> debug1: Trying private key: /home/emmm/.ssh/id_ecdsa
> debug1: Trying private key: /home/emmm/.ssh/id_ed25519
> debug1: Next authentication method: keyboard-interactive

I'm now going to comprehend the debugging output.
On the client ssh tried to use my private key, but failed?

> now you should be able to ssh into that server with pk authorization.
>
> If that works you can go on and disable the password authorization by
> setting on the server sshd config
>
> PasswordAuthentication no

By changing only this line of sshd config, the result is

$ ssh -p 9999 testac@192.168.0.5
Permission denied (publickey,keyboard-interactive).
$ ssh -p 9801 -l testac -i ~/.ssh/id_rsa_for_test 192.168.0.5
Permission denied (publickey,keyboard-interactive).

I'll try further and am consulting
http://unix.stackexchange.com/questions/36540/why-am-i-still-getting-a-password-prompt-with-ssh-with-public-key-authentication
and so on.

$ ls -ls /home/testac/.ssh
total 12
4 -rwx------ 1 u1 u1 776 Dec  8 11:05 authorized_keys
4 -rw-r--r-- 1 u1 u1 388 Dec  6 11:57 id_rsa_test.pub
4 -rwx------ 1 u1 u1 444 Dec  6 20:46 known_hosts

Cheers,
EenyMeenyMinyMoa

Reply to: