Window生成ssh秘钥的方法
D:\> ssh-keygen /?
D:\> ssh-keygen -t rsa -b 2048 -C "xxxxxx@163.com"
......
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
......
此时决定是否输入密码
Linux生成ssh秘钥的方法
先看看是不是已经有啦, 如果有内容就直接copy贴过去就行啦
> # ssh-keygen --help
usage: ssh-keygen [-q] [-b bits] [-t dsa | ecdsa | ed25519 | rsa | rsa1]
[-N new_passphrase] [-C comment] [-f output_keyfile]
ssh-keygen -p [-P old_passphrase] [-N new_passphrase] [-f keyfile]
ssh-keygen -i [-m key_format] [-f input_keyfile]
ssh-keygen -e [-m key_format] [-f input_keyfile]
......
> # cat ~/.ssh/id_rsa.pub
如果上一步没有这个文件, 我们就创建一个, 运行下面命令(邮箱改成自己的哦), 一路回车就好了
> # ssh-keygen -t rsa -C "xxxxxx@163.com"
> # cat ~/.ssh/id_rsa.pub
> # ssh -p 22 root@192.168.117.130
用途: Winodw 和 Linux 操作系统远程登录