标签:keygen hosts use 本地 alibaba dem ota user 复制
ssh-keygen -t rsa -C "XXXX@163.com" --->执行完会在~/.ssh/下生成公钥私钥对
查看公钥私钥对:
wucaiyundeMacBook-Pro:~ wucaiyun$ cd ~/.ssh/
wucaiyundeMacBook-Pro:.ssh wucaiyun$ ll
total 24
899401 0 drwx------ 5 wucaiyun staff 160 12 18 15:59 ./
686353 0 drwxr-xr-x+ 31 wucaiyun staff 992 12 19 16:42 ../
908256 8 -rw------- 1 wucaiyun staff 1823 12 5 23:25 id_rsa
908257 8 -rw-r--r-- 1 wucaiyun staff 399 12 5 23:25 id_rsa.pub
1745218 8 -rw-r--r-- 1 wucaiyun staff 350 12 19 17:13 known_hosts
ssh-copy-id -i .ssh/id_rsa.pub username@192.168.x.xxx
注意: ssh-copy-id 将key写到远程机器的 ~/ .ssh/authorized_key.文件中
wucaiyundeMacBook-Pro:~ wucaiyun$ ssh username@1xx.xx.xxx.xxx
Welcome to Alibaba Cloud Elastic Compute Service !
标签:keygen hosts use 本地 alibaba dem ota user 复制
原文地址:https://www.cnblogs.com/wucaiyun1/p/12069060.html