[英]Custom motd.tcl does not show at startup
我按照本教程來修改服務器的ssh歡迎消息,但是當我使用ssh時,我根本沒有消息...
以下是一些信息:
/etc/motd.tcl是可執行的
➜ ~ ls -l /etc/motd.tcl
-rwxr-xr-x 1 root root 3687 oct. 11 10:31 /etc/motd.tcl
/etc/motd.tcl位於/ etc / profile的末尾
➜ ~ sudo cat /etc/profile | grep motd
/etc/motd.tcl
我的/ etc / ssh / sshd_config包含以下幾行:
PrintMotd yes
PrintLastLog no
也許該教程已經過時,我必須進行一些更改,但是我沒有找到信息。
感謝您的任何提示。
編輯:問題似乎是由於zsh / oh-my-zsh所致,因為當我使用root帳戶(沒有zsh shell)登錄時,會顯示motd
在本教程中,有以下部分:
# * Check if we're somewhere in /home
#if {![string match -nocase "/home*" $var(path)]} {
if {![string match -nocase "/home*" $var(path)] && ![string match -nocase "/usr/home*" $var(path)] } {
return 0
}
我已經用return 0
之前的puts
進行了驗證,該密碼在我登錄並顯示MOTD時會顯示, if
執行, if
阻止腳本的其余部分輸出任何內容。 刪除這些行,它將按預期工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.