fixing ssh connection problem.

I had a problem to access on my fedora 15 by ssh. I couldn't login from remote and even local machine.
When I access to the laptop I got following error message. I goolged this error message but I coulnd't find solution. One of the reason is .ssh directory and files permission are't wrong.

[masami@moon]~% ssh masami@192.168.1.25              
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

so I checked /var/log/secure but there was no information about it. Then I checked /var/log/message I found following messages.

Mar  6 00:06:20 moon setroubleshoot: SELinux is preventing /usr/sbin/sshd from search access on the directory /home/masami/.ssh. For complete SELinux messages. run sealert -l a4f33433-38a1-45bc-875e-e95199704e47
Mar  6 00:06:20 moon setroubleshoot: SELinux is preventing /usr/sbin/sshd from search access on the directory /home/masami/.ssh. For complete SELinux messages. run sealert -l a4f33433-38a1-45bc-875e-e95199704e47

As you can see sshd command couldn't access to the my .ssh directory so I ran sealert and followed it how to fix the problem.

I did the command but I couldn't login so I check /var/log/messages again then I saw that message.

Mar  6 00:08:13 moon setroubleshoot: SELinux is preventing /usr/sbin/sshd from read access on the file /home/masami/.ssh/authorized_keys. For complete SELinux messages. run sealert -l a5bd9318-4061-423a-8695-5f17bf615128
Mar  6 00:08:13 moon setroubleshoot: SELinux is preventing /usr/sbin/sshd from read access on the file /home/masami/.ssh/authorized_keys. For complete SELinux messages. run sealert -l a5bd9318-4061-423a-8695-5f17bf615128

As you can guess what I have done is :)

I ran the command then tried ssh access then finally I could login my laptop by ssh :)