close

因為最近常常需要透過 SSH 登入 NAS 管理 Docker,所以想設定免密碼登入方便些,設定過程中發現一些和其他 Linux 設定不一樣的地方,故寫了這邊文章記錄一下...

 

1. 使用 SSH 登入後先用一般 user 建立 ~/.ssh 和 authorized_keys 公鑰

mkdir -p ~/.ssh && cd ~/.ssh && vi authorized_keys

2. 設定權限

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
sudo chmod 755 /volume1/homes/<你自己的使用者名>

3. 編輯 /etc/ssh/sshd_config 啟用下面兩個選項

sudo vim /etc/ssh/sshd_config
RSAAuthentication yes
PubkeyAuthentication yes

3. 重新載入 sshd config

sudo synoservicectl --reload sshd

4. 可以使用 SSH RSA KEY 登入囉!

 

arrow
arrow
    全站熱搜

    AwEi 發表在 痞客邦 留言(0) 人氣()