본문 바로가기
etc

우분투 접근 가능 ip 설정 / ssh 접근 가능 ip 설정

by 타닥타닥 토다토닥 부부 2023. 3. 19.
반응형

우분투 접근 가능 ip 설정 / ssh  접근 가능 ip 설정

 

1. hosts.allow 파일 열기

sudo vi /etc/hosts.allow

2. hosts.allow 파일 원하는 아이피 추가

 # /etc/hosts.allow: list of hosts that are allowed to access the system.
 #                   See the manual pages hosts_access(5) and hosts_options(5).
 #
 # 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: 0.0.0.0

->  shift + :  ->  wq  (파일저장)

 

3. hosts.deny 파일 열기

 sudo vi /etc/hosts.deny

4. hosts.deny 파일 sshd: ALL 입력

# /etc/hosts.deny: list of hosts that are _not_ allowed to access the system.
#                  See the manual pages hosts_access(5) and hosts_options(5).
#
# Example:    ALL: some.host.name, .some.domain
#             ALL EXCEPT in.fingerd: other.host.name, .other.domain
#
# 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.
#
# The PARANOID wildcard matches any host whose name does not match its
# address.
#
# You may wish to enable this to ensure any programs that don't
# validate looked up hostnames still leave understandable logs. In past
# versions of Debian this has been the default.
# ALL: PARANOID

sshd: ALL

->  shift + :  ->  wq  (파일저장)

 

5. sshd 서버 재시작

service sshd restart
반응형

댓글