OS버전별로 설정법이 달라짐
1
# 로키 리눅스 9.4
useradd topas
passwd topas
[root@ro94 sshd_config.d]# pwd
/etc/ssh/sshd_config.d
[root@ro94 sshd_config.d]# vi 01-permitrootlogin.conf
변경 전 PermitRootLogin yes
변경 후 PermitRootLogin no
[root@ro94 sshd_config.d]# service sshd restart
Redirecting to /bin/systemctl restart sshd.service
# local에서 root로 로그인 테스트 - 안되어야 한다.
[root@ro94 sshd_config.d]# ssh -l root 127.0.0.1
The authenticity of host '127.0.0.1 (127.0.0.1)' can't be established.
ED25519 key fingerprint is SHA256:g9Agv8DjgD5hbhimSBPSWrrYchDRdmqklPSBiWdiJ8A.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '127.0.0.1' (ED25519) to the list of known hosts.
root@127.0.0.1's password:
Permission denied, please try again.
root@127.0.0.1's password:
결과
[root@ro94 sshd_config.d]# ssh -l topas 127.0.0.1
topasvga@127.0.0.1's password:
[topasvga@ro94 ~]$ su - root
Password:
#
다음
https://brunch.co.kr/@topasvga/4714