CentOS 관리시에 접속 문구에 내가 원하는 정보들을 한꺼번에 출력하게 하고 싶었다.
그래서 찾아보았을때 /etc/issue.net 파일에 원하는 정보들을 넣으라고 해서 그렇게 설정한 뒤 sshd 재시작을 하였다.
그 후 내용에 변경이 생겨 다시 찾아봤는데 issue.net말고도 다양한 방법이 있더라.
찾아보니까 다 비슷한 기능을 하지만 엄연히는 다른 설정이었다. 그 설정에 대해서 알아보자!
Banner File
그냥 귀여운 문구를 넣으려고 생각했던 설정이지만, 원칙적으로 인가받지 않은 사용자에 대한 경고 문구등을 표현하기 위한 기능이다.
About Legal issue
법적으로 서버 관리시에 사용자가 로그인하기 전에 banner를 출력해야한다고 recommended 하고 있다. 영어적 뉘앙스에서 recommend가 무엇을 뜻하는지 모르겠지만, 강제보다는 약하고 추천보다는 쎈 권장 정도 인 것 같다. 1990년, 2000년에 발표한 뭐시기 법때문이라는데 wiki에 링크 걸린 주소가 not found.
/etc/motd
Console login The content of this file is shown after the user has logged in, and immediately before the shell is started.
사용자가 로그인 하고 나서 콘솔에 보여지는 내용. 쉘이 시작전에 바로, 즉시 보여지는 내용.
/etc/issue.net
Network login
OBS By default is this disabled in ssh!
The content of this file is shown when a ssh session is connected and before the authorization.
To enable this in ssh you have to follow this simple steps:
1. Create a /etc/issue.net file and fill it with the desired context
2. Edit /etc/ssh/sshd_config, to look like this Banner /etc/issue.net
3. Restart sshd, service sshd restart
ssh 세션이 맺어진 후, 인증이 되기 전에 보여주는 내용
설정 방법은 아래와 같다.
1. vi /etc/issue.net을 통해 해당 파일에 내용을 입력한다.
2. vi /etc/ssh/sshd_config 을 통해 Banner /etc/issue.net 옵션을 추가한다.
3. sshd 재시작한다.
Banner Example
헐.. 역시 개발자들은...
#####
#######
@ ##O#O##
###### @@# #VVVVV#
## # ## VVV ##
## @@@ ### #### ### ### ##### ###### # ##
## @ @# ### ## ## ## ### ## # ##
## @ @# ## ## ## ## ### # ###
## @@# ## ## ## ## ### QQ# ##Q
## # @@# ## ## ## ## ## ## QQQQQQ# #QQQQQQ
## ## @@# # ## ## ### ### ## ## QQQQQQQ# #QQQQQQQ
############ ### #### #### #### ### ##### ###### QQQQQ#######QQQQQ
Linux Version 2.6.18-53.1.4.el5, Compiled #1 SMP Fri Nov 30 00:45:16 EST 2007
One 2.19GHz AMD AMD Turion(tm) 64 Mobile ML-40 Processor, 256M RAM, 4394.20 Bogomips Total
localhost.localdomain
출처 : https://wiki.centos.org/TipsAndTricks/BannerFiles
/etc/issue.net 과 /etc/issue 비교
Both /etc/issue.net and /etc/issue are used to display a banner (e.g. welcome line/ warning..) to SSH users before the login prompt:
- /etc/issue.net is shown to the users who connect from the network.
- /etc/issue is shown to both local users and network users unless /etc/issue.net is present and configured.
Also, to configure them to be displayed when you login via SSH, you need to uncomment #Banner and specify the desired filename at /etc/ssh/sshd_config, like:
Banner /etc/issue.net
The filename /etc/issue.net is the historical location for pre-login banners for network logins using protocols like telnet or rlogin. Some Unix vendors had a version of telnetd, rshd and/or rlogind that used /etc/issue for network logins too; others made it configurable like sshd does now.
출처 : https://serverfault.com/questions/922235/what-is-the-difference-between-etc-issue-net-and-etc-issue
공통점
- 둘 다 SSH 유저의 로그인 프롬프트가 뜨기 전에 배너를 보여준다.
차이점
- /etc/issue.net은 네트워크(ssh,telnet 등)으로부터 연결한 사용자에게 보여진다.
- /etc/issue는 로컬 사용자 및 네트워크로부터 연결한 사용자에게 보여진다. 만약 지정되어 있지 않으면 /etc/issue.net이 보여진다.
즉, issue.net은 원격 접속자에게만 보여지는 문구이고, issue는 로컬/원격 접속자에게 보여진다.
결론
1. Banner 기능은 서버에 접속하고자 하는 사용자에게 보여지는 문구이다.
2. 로그인 전에 보이는 문구 설정은 /etc/issue.net 와 /etc/issue에서 설정한다.
- 로그인전에 보이는 문구이기 때문에 경고 문구를 주로 설정한다.
- 차이점은 원격 사용자에게만 보이느냐, 원격과 로컬 사용자 모두에게 보이느냐이다.
3. 로그인 후에 보이는 문구 설정은 /etc/motd에서 설정한다.
- 로그인 후에 사용자에게 공지할 문구를 주로 설정한다.
'2 > Server' 카테고리의 다른 글
Barrier 사용이 안되지만... 해결이 안되었다. (0) | 2020.08.10 |
---|---|
구름 OS에서 Synergy와 비슷한 Barrier 사용하기 (1) | 2020.08.10 |
윈도우 10 실행창 명령어 (0) | 2020.07.10 |
Windows server RDP 추가 (0) | 2019.12.04 |
계정별 locale 설정 (0) | 2019.09.26 |