Skip to content

Hostname

이름 변경

/etc/hostname 파일의 내용을 수정하거나 hostnamectl 명령을 사용하면 된다.

hostnamectl set-hostname {바꿀호스트명}

hosts.allow, hosts.deny

두 파일을 사용하면 접속제한을 할 수 있다. SSH접속 제한을 예로 설명하면 아래와 같다.

우선 특정 IP (대역)에 대하여 SSHD 접속 허용하는 예제는 아래와 같다.

#
# 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.
sshd: 192.168.0.

위에 해당하지 않는 모든 IP는 SSHD에 대하여 접속거부한다.

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