본문으로 바로가기

[RHEL/CentOS 8] Banner 문구 및 설정방법

category Linux/RHEL7 & 8 2021. 10. 7. 11:18
반응형

리눅스 시스템에 로그인할 때와 성공했을때 배너를 설정하는 방법에 대해 설명합니다.

 

/etc/issue.net 파일에는 사용자가 ssh 접속을 시도할 때 나타나는 문장입니다.

 

/etc/motd 파일에는 원격 접속이 완료되면 나타나는 문자입니다.

 

 

 

1.  issue.net 파일에 내용 추가

[root@hk-tb etc]#vi /etc/issue.net

     ******************************************************************
     * This system is for the use of authorized users only. Usage of  *
     * this system may be monitored and recorded by system personnel. *
     * Anyone using this system expressly consents to such monitoring *
     * and is advised that if such monitoring reveals possible        *
     * evidence of criminal activity, system personnel may provide    *
     * the evidence from such monitoring to law enforcement officials.*
     ******************************************************************

 

 

2.  sshd_config 설정

[root@hk-tb etc]#vi /etc/ssh/sshd_config


# 설정 전
# no default banner path
#Banner none


# 설정 후 
# no default banner path
Banner /etc/issue.net

 

 

3.  sshd 서비스 재기동 및 ssh 접속 확인

ssh 접속시 설정한 배너가 출력되는 것을 확인할 수 있습니다.

[root@hk-tb etc]#systemctl restart sshd

[root@hk-tb etc]#exit


hkjeon@MacBook-Pro ~ % kvm
     ******************************************************************
     * This system is for the use of authorized users only. Usage of  *
     * this system may be monitored and recorded by system personnel. *
     * Anyone using this system expressly consents to such monitoring *
     * and is advised that if such monitoring reveals possible        *
     * evidence of criminal activity, system personnel may provide    *
     * the evidence from such monitoring to law enforcement officials.*
     ******************************************************************
Last login: Thu Oct  7 11:09:50 2021 from 1.1.1.201
[root@hk-tb ~]#

 

 

4.  motd 파일 내용 추가

ssh 원격 접속 및 로그인이 완료된 후 출력되는 배너를 설정하기 위해 motd 파일 내용을 추가합니다.

[root@hk-tb ~]#vi /etc/motd



###############################################################
#                                                             #
#                                                             #
#     Welcome To KVM Host for HK Jeon.!                       #
#                                                             #
#                                                             #
###############################################################

 

 

5.  재 접속을 통해 적용확인

재 로그인을 통해 설정 한 두 개의 모든 배너가 정상적으로 적용되었는지 확인합니다.

 

hkjeon@MacBook-Pro ~ % kvm
     ******************************************************************
     * This system is for the use of authorized users only. Usage of  *
     * this system may be monitored and recorded by system personnel. *
     * Anyone using this system expressly consents to such monitoring *
     * and is advised that if such monitoring reveals possible        *
     * evidence of criminal activity, system personnel may provide    *
     * the evidence from such monitoring to law enforcement officials.*
     ******************************************************************



###############################################################
#							   								  #
#							       							  #
#     Welcome To KVM Host for HK Jeon.! 		              #
#							      						      #
#							      							  #
###############################################################
Last login: Thu Oct  7 11:16:00 2021 from 1.1.1.201
[root@hk-tb ~]#

 

 

 

728x90