產生公私鑰
mkdir -p ~/.ssh
cd ~/.ssh
ssh-keygen -f id_rsa -t rsa -N ''
將公鑰寫入server的authorized_keys
cat ~/.ssh/id_rsa.pub | ssh username@serverip "cat >> ~/.ssh/authorized_keys"
文章短網址: https://slanla.com/__8zavev
mkdir -p ~/.ssh
cd ~/.ssh
ssh-keygen -f id_rsa -t rsa -N ''
cat ~/.ssh/id_rsa.pub | ssh username@serverip "cat >> ~/.ssh/authorized_keys"