특정 IP만 SSH 접속 허용하기 > 자유게시판

자유게시판

특정 IP만 SSH 접속 허용하기 정보

특정 IP만 SSH 접속 허용하기

본문

서버관리시 Root를 사용하기 위해 특정 IP만 SSH에 접속 가능 하도록 아래 방법으로 수정해 보았습니다.

 

/etc/hosts.allow 수정

#
# 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: 113.157.124.168, 135.79.246.

→ 113.157.124.168와 135.79.246.XXX 대역을 허용
위와 같이 한줄에 적어도 되지만, 아이피가 많아지면 관리가 어렵다. 아래와 같이 여러줄로 나누어 적어도 된다.
sshd: 113.157.124.168
sshd: 135.79.246.


/etc/hosts.deny 수정

#
# 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

ALL 적용시 나머지는 모두 ssh 접근 불가 sshd 재시작 해야 정상 적용된다.

# service sshd restart
Stopping sshd: [ OK ]
Starting sshd: [ OK ]

 

출처 : http://www.nanoomi.org/bbs/board.php?bo_table=03_2&wr_id=5&page=2 

추천
0

댓글 2개

전체 199,665 |RSS
자유게시판 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT