카테고리 없음
[ssh] sshd_config 설정
냐옴
2022. 1. 14. 10:45
sshd_config 수정
sudo vi /etc/ssh/sshd_config
# /etc/ssh/sshd_config
Port 22
ListenAddress 0.0.0.0
ListenAddress ::
# root 로그인 비활성화
PermitRootLogin no
StrictModes yes
MaxAuthTries 6
MaxSessions 10
# 클라이언트가 300초 동안 입력이 없으면 연결을 종료시킴
TCPKeepAlive yes
ClientAliveInterval 300
ClientAliveCountMax 0
PasswordAuthentication no
PermitEmptyPasswords no
PubkeyAuthentication yes
# Expect .ssh/authorized_keys2 to be disregarded by default in future.
# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile .ssh/authorized_keys
수정 후 ssh 서비스 재시작
sudo systemctl restart ssh # ubuntu
sudo systemctl restart sshd # centos