-
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 通過搜索目錄,會發現生成的兩個秘鑰,一個私鑰、一個公鑰
秘鑰.png
-
id_rsaid_rsa.pub為公鑰,即要用到的