配置 SSH 伺服器以接受連線

首先,我們必須編輯 SSH 守護程式配置檔案。雖然在不同的 Linux 發行版下,它可能位於不同的目錄中,但通常它儲存在/etc/ssh/sshd_config

使用文字編輯器更改此檔案中設定的值,所有以#開頭的行都會被註釋掉,並且必須刪除此字元才能生效。建議清單如下。

Port (chose a number between 0 - 65535, normaly greater than four digits)
PasswordAuthentication yes
AllowUsers    user1 user2 ...etc

請注意,最好一起禁用密碼登入,並使用 SSH 金鑰以提高安全性,如本文件中所述。