😊杨鼎睿的笔记

Search

Search IconIcon to open search

使用 ssh-copy-id 工具自动上传公钥实现 ssh 连接不输入密码

Last updated Dec 16, 2022 Edit Source

一键,非常轻松

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
❯ ssh-copy-id [email protected]  
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/abser/.ssh/id_rsa.pub"  
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already  
installed  
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install  
the new keys  
[email protected]'s password:    
Permission denied, please try again.  
[email protected]'s password:    
  
Number of key(s) added: 1  
  
Now try logging into the machine, with:   "ssh '[email protected]'"  
and check to make sure that only the key(s) you wanted were added.