티스토리 뷰

IT/Unix/Linux

CentOS 7.4 Public Key 인증 설정

래빗조아 2020. 2. 25. 11:00

CentOS 7.4 기본 설정에서 public key 배포후 인증 로그인이 되지 않아서 두 가지 작업이 필요하다.

/etc/ssh/sshd_config 설정

[root@localhost ~]$ more /etc/redhat-release

CentOS Linux release 7.4.1708 (Core)

[root@localhost ~]$ vi /etc/ssh/sshd_config

PubkeyAuthentication yes

[root@localhost ~]# service sshd restart

Redirecting to /bin/systemctl restart sshd.service

디렉터리 및 파일 permission

[naru@localhost ~]$ chmod 700 .ssh/

[naru@localhost ~]$ chmod 600 .ssh/authorized_keys

 

 

댓글