ssh 특정 IP의 접속만 허용하는 방법

EPguy·2023년 2월 22일
  1. /etc/hosts.allow 수정

    vi /etc/hosts.allow

#
# Example:    ALL: LOCAL @some_netgroup
#             ALL: .foobar.edu EXCEPT terminalserver.foobar.edu
#
# If you're going to protect the portmapper use the name "rpcbind" for the
# daemon name. See rpcbind(8) and rpc.mountd(8) for further information.
#
sshd: 접속 허용할 IP
sshd: 192.168.1.1
sshd: 192.168.1.2
  1. /etc/hosts.deny 수정

    vi /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
profile
epguygithub@gmail.com

0개의 댓글