소프트웨어(SW)/GNU - 리눅스(Linux)
[GNU - 리눅스(Linux)] motd 메시지를 수정하는 방법
도도(Dodo)
2023. 5. 4. 07:55
728x90
300x250
[GNU - 리눅스(Linux)] motd 메시지를 수정하는 방법
다음처럼 ssh 로그인 시 motd 메시지를 출력하는 방법을 소개하도록 하겠다.
[설치 방법]
1. Disable all current default MOTD’s daemon scripts
$ sudo chmod -x /etc/update-motd.d/* |
2. Install prerequisites
$ sudo apt install inxi screenfetch ansiweather |
3. Create a new script, eg. /etc/update-motd.d/01-custom with the following bash script:
(예를 들어 다음 bash 스크립트를 사용하여 스크립트 파일을 만듭니다. /etc/update-motd.d/01-custom:)
#!/bin/sh echo "GENERAL SYSTEM INFORMATION" /usr/bin/screenfetch echo echo "SYSTEM DISK USAGE" export TERM=xterm; inxi -D echo echo "CURRENT WEATHER AT THE LOCATION" # Show weather information. Change the city name to fit your location ansiweather -l bratislava |
4. Make this script executable (이 스크립트를 실행 가능하게 만드십시오.)
$ sudo chmod +x /etc/update-motd.d/01-custom |
모두 끝났습니다. 이 단계에서 Ubuntu 18.04 / 20.04 / 22.04 서버 또는 데스크탑에 다시 로그인하고 새 MOTD 정보를 확인하기만 하면 됩니다.
[참고 자료]
1. How to change welcome message (motd) on Ubuntu 18.04 server, https://linuxconfig.org/how-to-change-welcome-message-motd-on-ubuntu-18-04-server , 2020. 05. 27 by Lubos Rendek,
반응형