Notice
Recent Posts
Recent Comments
Link
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Archives
Today
Total
05-16 04:51
관리 메뉴

nomad-programmer

[Linux/Rocky] SSH Root 로그인하는 방법 (root 접속 허용) 본문

OS/Rocky

[Linux/Rocky] SSH Root 로그인하는 방법 (root 접속 허용)

scii 2023. 9. 10. 00:42

/etc/ssh/sshd_config 파일이다. ssh_config에 "PermitRootLogin yes" 라인을 추가했다가 지웠다하면서... sshd 서비스 재시작을 계속하면서... 도대체 왜 안될까? 삽질을 했다.

방법 1) sshd_config파일에 추가하는 방법

/etc/ssh/sshd_config 파일 마지막에 다음과 같은 라인을 추가하고 ssh 데몬을 재시작하면 root 계정으로 ssh 접속이 가능해진다.

# /etc/ssh/sshd_config 파일의 마지막 라인에 추가.
...
PermitRootLogin yes

# 그 후, ssh 데몬 재시작
systemctl restart sshd

방법 2) sshd_config.d 디렉토리에 conf파일을 추가하는 방법

vim /etc/ssh/sshd_config.d/01-permitrootlogin.conf

# 해당 파일 내용에 다음과 같은 라인 추가
PermitRootLogin yes

# ssh 데몬 재시작
systemctl restart sshd

 

참고 사이트

https://www.centlinux.com/2023/05/disable-ssh-root-login-in-rocky-linux-9.html

 

Disable SSH Root Login in Rocky Linux 9

© 2023 CentLinux. All Rights Reserved.

www.centlinux.com

 

Comments