사이트 내 전체검색
ssh 보안설정
로빈아빠
https://cmd.kr/server/40 URL이 복사되었습니다.

본문

1) /etc/hosts.deny 을 열어서 아래처럼 변경하여 줍니다.  sshd: ALL 은 모든  ssh 로그인을 금지한다는 것입니다. 설사 아이디 및 비번이 맞아도 접근이 되지 않습니다.

#
# hosts.deny        This file describes the names of the hosts which are
#                *not* allowed to use the local INET services, as decided
#                by the '/usr/sbin/tcpd' server.
#
# The portmap line is redundant, but it is left to remind you that
# the new secure portmap uses hosts.deny and hosts.allow.  In particular
# you should know that NFS uses portmap!      sshd : ALL
sshd : ALL

2) 다음에  /etc/hosts.allow 을 열어서 아래처럼 변경합니다. 아래에 등록된 IP 만 접속이 가능합니다. 그 외는 접속자체가 불가 합니다.

#
# hosts.allow        This file describes the names of the hosts which are
#                allowed to use the local INET services, as decided
#                by the '/usr/sbin/tcpd' server.
#
sshd : 111.111.111.111: ALLOW
sshd : 111.111.111.112: ALLOW
sshd : 111.111.111.113: ALLOW

3) 위처럼 한 다음 아래처럼 ssh 를 재 시작하면 완료됩니다

# service sshd restart

출처 : http://qdata.co.kr/bo/bbs/board.php?bo_table=ltip&wr_id=304

댓글목록

등록된 댓글이 없습니다.

1,139 (2/23P)

Search

Copyright © Cmd 명령어 3.138.181.100