remote ssh 서버에 공개키를 등록하고 .ssh 폴더와 authorized_keys 파일의 permission 도 맞는데 자동 로그인이 안 됨.
원인
사용자의 홈디렉토리나 .ssh 의 SELinux context 가 맞지 않으면 sshd가 authorized_keys 을 읽을 수 없어서 자동 로그인이 안 될수 있음
해결
audit2why 로 SELinux audit 확인
audit2why < /var/log/audit/audit.log
CODE
type=AVC msg=audit(1389772205.869:373802): avc: denied { search } for pid=31947 comm="sshd" name="/" dev=dm-2 ino=2 scontext=unconfined_u:system_r:sshd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:file_t:s0 tclass=dir
Was caused by:
Missing type enforcement (TE) allow rule.
You can use audit2allow to generate a loadable module to allow this access.