[Linux] Authentication refused: bad ownership or modes for directory /root

김건호·2023년 9월 14일
0

개요

환경

Prolinux 8.2 minimal

상황

ssh 키기반 인증을 시도하던 중, 계속해서 password를 묻는 상황이 있어
journalctl -xeu sshd 로 로그를 확인 결과, Authentication refused: bad ownership or modes for directory /root 에러로 인해 키기반 인증을 실패한 상황

해결 과정

디렉토리 권한 변경

chmod 700 /root
chmod 700 /root/.ssh
chmod 600 /root/.ssh/authorized_keys

-> 권한 설정으로는 바뀌지 않았음


권한 변경 후, 발견 사항

/root 디렉토리 소유자가 root가 아닌 1000 1000 이였다

소유자 변경

chown root /root
chown root /root/.ssh

--> 변경 이후 해결되었다.

참고자료

https://www.dell.com/support/kbdoc/en-us/000061728/isilon-onefs-error-authentication-refused-bad-ownership-or-modes-for-directory-ifs-home-user-ssh-when-trying-to-connect-to-the-cluster-through-ssh

https://unix.stackexchange.com/questions/548327/authentication-refused-bad-ownership-or-modes-for-directory-root

profile
네.. 뭐.. 김건호입니다...

0개의 댓글