ssh-copy-id命令 可以把本地主機(jī)的公鑰復(fù)制到遠(yuǎn)程主機(jī)的authorized_keys文件上,ssh-copy-id命令也會(huì)給遠(yuǎn)程主機(jī)的用戶主目錄(home)和~/.ssh, 和~/.ssh/authorized_keys設(shè)置合適的權(quán)限。
- 語(yǔ)法
ssh-copy-id [-i [identity_file]] [user@]machine
- 選項(xiàng)
-i:指定公鑰文件
- 實(shí)例
實(shí)例1
ssh-copy-id user@server
實(shí)例2
ssh-copy-id -i ~/.ssh/id_rsa.pub user@server
- 參考文獻(xiàn)