要用 SSH public key authentication 通常會這樣做
ssh-keygen
scp ~/.ssh/id_rsa.pub remote-host
ssh remote-machine
cat id_rsa.pub >> ~/.ssh/authorized_keys
2-4 步驟可以用一行指令取代
ssh-copy-id -i ~/.ssh/id_rsa.pub remote-host
ref. 10 個最酷的 Linux 單行命令
Top Ten One-Liners from CommandLineFu Explained
CommandLineFu All commands sorted by votes
Leave a comment