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

Re: ssh doesn't work.



Hi,

2016-12-08 2:52 GMT+09:00 Greg Wooledge <wooledg@eeg.ccf.org>:
> On Thu, Dec 08, 2016 at 02:37:09AM +0900, EenyMeenyMinyMoa wrote:
>> $ 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
>
> Which machine is that -- the client, or the server?
>

the server.

> Check those things on the server, and also check:
> ls -ld / /home /home/testac /home/testac/.ssh
>
> Also make sure that "u1" is the actual owner of /home/testac.
> The discrepancy between the username shown by ls -l and the name
> of the home directory does not inspire confidence.

I changed the owner of /home/testac and the files on the server. And after operations obeying

2016-12-08 3:51 GMT+09:00 emetib <chadbrabec@gmail.com>:
> On Wednesday, December 7, 2016 at 11:40:04 AM UTC-6, EenyMeenyMinyMoa wrote:
>>
>> $ 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
>>
> check the perms on ~/.ssh
> should be 700, dwrx------
>
> and your authorized_keys should be 644, -rw-r--r--
 
$ sudo ls -la /home/testac/.ssh/
total 20
drwx------ 2 testac testac 4096 Dec  8 07:57 .
drwxr-xr-x 4 testac testac 4096 Dec  8 07:49 ..
-rw-r--r-- 1 testac testac  776 Dec  8 11:05 authorized_keys
-rw-r--r-- 1 testac testac  388 Dec  6 11:57 id_rsa_for_test.pub
-rwx------ 1 testac testac  444 Dec  6 20:46 known_hosts

and tried.

$ ssh -p 9999 testac@192.168.0.5

Then a dialog box prompting me to enter my private key appeared.
After entering it, I could login.
Already at this stage(PasswordAuthentication yes), the prompt
testac@192.168.0.5's password:
didn't appear.
Next I changed /etc/ssh/ssh_config on the server

PasswordAuthentication no

and after executing

$ sudo systemctl restart ssh

, then I could successfully login too.  
Thank you everyone!

Cheers,
EenyMeenyMinyMoa

Reply to: