mac 系統(tǒng)開始就已經(jīng)為我們安裝了ssh 如果沒有安裝沒,首先安裝;這個在網(wǎng)上到處都是。
打開終端:$ 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已經(jīng)安裝,
- 打開終端,$ ssh-keygen 一路enter下。
- 生成 在當前用戶名下 會有一個.sh文件。
- 查看 .ssh
$ ls -a ~/.ssh 通過搜索目錄
id_rsa id_rsa.pub
- 打開 id_rsa.pub文件 里面就有需要的ssh key。