sanne@Surendras-MacBook-Pro:~ > ssh tlj Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-93-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage Get cloud support with Ubuntu Advantage Cloud Guest: http://www.ubuntu.com/business/services/cloud Last login: Sat Oct 1401:00:432017 from 20.244.25.231 root@linuxnix:~# exit logout Connection to 18.197.176.13 closed.
例 2: 不用密码用 ssh 密钥登到系统要用 IdentityFile 。
例:
1 2 3 4 5 6
Host aws User ec2-users HostName ec2-54-200-184-202.us-west-2.compute.amazonaws.com IdentityFile ~/Downloads/surendra.pem port22
Host tlj linuxnix linuxnix.com Userroot HostName 18.197.176.13 port 22
输出:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
sanne@Surendras-MacBook-Pro:~ > ssh tlj Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-93-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage Get cloud support with Ubuntu Advantage Cloud Guest: http://www.ubuntu.com/business/services/cloud Last login: Sat Oct 1401:00:432017 from 220.244.205.231 root@linuxnix:~# exit logout Connection to 18.197.176.13 closed. sanne@Surendras-MacBook-Pro:~ > ssh linuxnix.com Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-93-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Get cloud support with Ubuntu Advantage Cloud Guest: http://www.ubuntu.com/business/services/cloud Last login: Sun Oct 1520:31:082017 from 1.129.110.13 root@linuxnix:~# exit logout Connection to 138.197.176.103 closed. [6571] sanne@Surendras-MacBook-Pro:~ > ssh linuxnix Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-93-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage Get cloud support with Ubuntu Advantage Cloud Guest: http://www.ubuntu.com/business/services/cloud Last login: Sun Oct 1520:31:202017 from 1.129.110.13 root@linuxnix:~# exit logout Connection to 18.197.176.13 closed.