hosts.allow deny
hosts.allow allow
특정한 클라이언트에게만 서비스를 허용(allow) 또는 차단(deny)하는 역활을 한다
[root@vm129 ~]# cat /etc/hosts.deny
#
# hosts.deny This file contains access rules which are used to
# deny connections to network services that either use
# the tcp_wrappers library or that have been
# started through a tcp_wrappers-enabled xinetd.
#
# The rules in this file can also be set up in
# /etc/hosts.allow with a 'deny' option instead.
#
# See 'man 5 hosts_options' and 'man 5 hosts_access'
# for information on rule syntax.
# See 'man tcpd' for information on tcp_wrappers
#
ALL:ALL
모든 클라이언트를 차단시키고 진행 한다 ALL:ALL
[root@vm129 ~]# cat /etc/hosts.allow
#
# hosts.allow This file contains access rules which are used to
# allow or deny connections to network services that
# either use the tcp_wrappers library or that have been
# started through a tcp_wrappers-enabled xinetd.
#
# See 'man 5 hosts_options' and 'man 5 hosts_access'
# for information on rule syntax.
# See 'man tcpd' for information on tcp_wrappers
#
sshd : 192.168.5.120:allow
sshd 특정 클라인트만 허용하고 후 저장한다
http://https://hansoul.tistory.com/184전에 포스팅에서 ssh 연결하는 작업을 하였다
A서버(192.168.5.129)->B(192.168.5.130)
현재 deny에서 모든 클라이언트 접속을 차단 시켰고 192.168.5.120 만 접속가능하게 설정했기 때문에 접속이 실패처리 됨
[root@vm129 ~]# cat /etc/hosts.allow
#
# hosts.allow This file contains access rules which are used to
# allow or deny connections to network services that
# either use the tcp_wrappers library or that have been
# started through a tcp_wrappers-enabled xinetd.
#
# See 'man 5 hosts_options' and 'man 5 hosts_access'
# for information on rule syntax.
# See 'man tcpd' for information on tcp_wrappers
#
sshd : 192.168.5.130:allow
다시 B서버 ip인 130을 접속허용 시킨다
변경시 다시 접속이 되는건 확인 할수 있다
4. ip 대역대 허용
[root@vm129 ~]# cat /etc/hosts.allow
#
# hosts.allow This file contains access rules which are used to
# allow or deny connections to network services that
# either use the tcp_wrappers library or that have been
# started through a tcp_wrappers-enabled xinetd.
#
# See 'man 5 hosts_options' and 'man 5 hosts_access'
# for information on rule syntax.
# See 'man tcpd' for information on tcp_wrappers
#
sshd : 192.168.5.0/192.168.5.255:allow
0~255 모든 대역대에서 접속이 가능 한걸 확인 할수 있다 회사같은 곳에서 ip대역대로 설정하여 직원들 접속을 가능하게 설정을 많이 한다
Failed to restart network.service: Unit network.service not found. centos8 , redhat8 (0) | 2022.12.13 |
---|---|
[Linux] 자주 쓰는 찾기 명령어 grep,find,ls,tail (0) | 2022.12.09 |
[linux] 리눅스 ssh 연결하여 접속하기 (0) | 2022.10.13 |
[linux] history 날짜 시간 일자 출력 하기 (0) | 2022.08.22 |
Missing or invalid credentials. (0) | 2022.07.07 |
댓글 영역