SSH 접속 문구 설정하기

 원격으로 서버를 접속할 때, 서버의 상태를 보여준다면 유용할 것이다.우분투 서버를 이용할 경우, SSH접속 시에 우분투 서버의 상태를 간략히 보여준다.
참고 : https://help.ubuntu.com/community/SSH/OpenSSH/Configuring
 먼저 SSH설정 파일을 편집한다.
$ vi /etc/ssh/sshd_config
 Banner 설정 부분에서 # 문자를 제거하여 Banner를 활성화 시킨다.
Banner /etc/issue.net
 그리고 접속 문구를 편집한다.
$ vi /etc/issue.net
 SSH서비스를 재시작 한다.
$ sudo /etc/init.d/ssh restart
 재시작후, ssh접속을 하면, 다음과 같은 접속 문구를 볼 수 있을 것이다.
login as: User_ID
Ubuntu 12.04 LTS
**********
Notice to users

Don't do that!!!
**********
User_ID@domain's password:
 그리고 로그인에 성공을 하면 다음과 같은 내용을 출력한다.
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-24-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

  System information as of Fri Jun  8 12:56:02 KST 2012

  System load:  0.0                Processes:           99
  Usage of /:   8.5% of 123.00GB   Users logged in:     1
  Memory usage: 51%                IP address for eth0: 111.222.111.222
  Swap usage:   0%

  Graph this data and manage this system at https://landscape.canonical.com/
Last login: Fri Jun  8 10:03:21 2012 from 210.92.9.204
 위 메시지는
/etc/motd
의 내용을 출력한 것으로 sshd_config 파일의 PrintLastLog 값(yes, no)을 이용해서 켜고 끌수 있다.
PrintLastLog yes
 Message of The Day(/etc/motd)의 내용은 update-motd.d에서 변경이 가능하다.
/etc/update-motd.d/
 새로운 내용을 추가 하고 싶다면
$ sudo vi /etc/motd.tail
 파일을 만들어서 추가하면 된다. Last login 앞 부분에 원하는 내용이 추가된다.


댓글 쓰기