헤드리스 Ubuntu SSH 서버에서 손상된 update-motd.d 폴더 및 파일 수정

헤드리스 Ubuntu SSH 서버에서 손상된 update-motd.d 폴더 및 파일 수정

내 안드로이드 장치에서 ssh를 부팅할 때 표시되도록 motd .d 파일을 수정하려고 했고 온라인 튜토리얼을 사용하여 문제를 수정하려고 했습니다.

run-parts /etc/update-motd.d이제 다음과 같은 오류가 계속 발생하기 때문에 입력하여 테스트할 수 없습니다 .

run-parts: failed to exec /etc/update-motd.d/00-header:Exec format error
run-parts: /etc/update-motd.d/00-header exited with return code 1
run-parts: failed to exec /etc/update-motd.d/10-sysinfo: Exec format error
run-parts: /etc/update-motd.d/10-sysinfo exited with return code 1
run-parts: failed to exec /etc/update-motd.d/90-footer: Exec format error
run-parts: /etc/update-motd.d/90-footer exited with return code 1

입력하면 systemctl status motd화면에 이런 내용이 나타납니다

motd.service
   Loaded: masked (/dev/null; bad)
   Active: inactive (dead)

파일 내용 /etc/update-motd.d/:

/etc/update-motd.d/00-header:  ASCII text
/etc/update-motd.d/10-sysinfo: ASCII text
/etc/update-motd.d/90-footer:  ASCII text

출력ls -l /etc/update-motd.d/

-rwxr-xr-x 1 root root 1429 Jun  9 14:22 00-header
-rwxr-xr-x 1 root root 1927 Jun  9 14:25 10-sysinfo
-rwxr-xr-x 1 root root 2205 Jun  9 14:29 90-footer

답변1

나는 실제로 같은 문제를 겪었고 내 실수는 매우 간단했습니다.

나는 그것을 잊어버렸다#!/bin/sh

관련 정보