-
mac 系统开始就已经为我们安装了ssh 如果没有安装没,首先安装;
-
打开终端:$ ssh -v
查看ssh版本
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
[-D [bind_address:]port] [-e escape_char] [-F configfile]
[-I pkcs11] [-i identity_file]
[-L [bind_address:]port:host:hostport]
[-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
[-R [bind_address:]port:host:hostport] [-S ctl_path]
[-W host:port] [-w local_tun[:remote_tun]]
[user@]hostname [command]
这个表明ssh已经安装, -
打开终端,$ ssh-keygen 一路enter下。
-
$ ls -a ~/.ssh 通过搜索目录,会发现生成的两个秘钥,一个私钥、一个公钥
-
id_rsaid_rsa.pub为公钥,即要用到的