πŸ”’μ •λ³΄λ³΄μ•ˆ/μ‹œμŠ€ν…œ λ³΄μ•ˆ

μ‹œμŠ€ν…œ λ³΄μ•ˆ - SSH root 원격 접속 차단 μ •μ±… μ„€μ •(/etc/ssh/sshd_config)

Janger 2023. 11. 10. 17:50
728x90

 

 

SSH root 원격 접속 차단 μ •μ±… μ„€μ •(/etc/ssh/sshd_config)

 

κΈ°μ‘΄ "PermitRootLogin yes"λ₯Ό "PermitRootLogin no"둜 μˆ˜μ •ν•œλ‹€. 

# vim /etc/ssh/sshd_config

# Authentication
PermitRootLogin no

 

섀정이 μ™„λ£Œν•˜μ˜€λ‹€λ©΄ μ„œλΉ„μŠ€λ₯Ό μž¬μ‹œμž‘ν•œλ‹€. 

service ssh restart

 

 

정책을 μ„€μ •ν•˜κΈ° 이전(PermitRootLogin yes)

 

root@kali:~/Desktop# ssh root@localhost
root@localhost's password: 
Linux kali 3.14-kali1-686-pae #1 SMP Debian 3.14.5-1kali1 (2014-06-07) i686

The programs included with the Kali GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Kali GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Nov 10 17:42:20 2023 from localhost
root@kali:~#

μ •μƒμ μœΌλ‘œ root 둜그인이 λœλ‹€. 

 

 

정책을 μ„€μ •ν•œ ν›„(PermitRootLogin no)

 

root@kali:~# ssh root@localhost
root@localhost's password: 
Permission denied, please try again.
root@localhost's password: 
Permission denied, please try again.

λΉ„λ°€λ²ˆν˜Έλ₯Ό 맞게 μž…λ ₯해도 κΆŒν•œμ΄ κ±°λΆ€λ˜μ—ˆλ‹€κ³  λ‚˜μ˜¨λ‹€. 

728x90