ssh-copy-id命令 能夠把本地主機的公鑰複製到遠程主機的authorized_keys文件上,ssh-copy-id命令也會給遠程主機的用戶主目錄(home)和~/.ssh
, 和~/.ssh/authorized_keys
設置合適的權限。linux
ssh-copy-id [-i [identity_file]] [user@]machine
-i:指定公鑰文件ssh
實例1ide
ssh-copy-id user@server
實例2.net
ssh-copy-id -i ~/.ssh/id_rsa.pub user@server
Linux命令大全code