ssh 免密碼登入

產生公私鑰

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"