問題描述
在Alpine鏡像中安裝了openssh-server和openssh之后,無法執行ssh localhost
。發現未啟動服務,開啟服務時報以下錯誤
/ # ls /etc/init.d/sshd
/etc/init.d/sshd
/ # /etc/init.d/sshd status
sh: /etc/init.d/sshd: not found
很明顯,sshd這個文件時有的。不能提示not found。通過查閱資料得到以下解決方法
解決方法
安裝這個工具
apk add openrc
原來not found時提示腳本第一行的shebang(#!/sbin/openrc-run)找不到。