一、作用

安全的远程连接服务器

二、选项

  • -i <登录名> 指定身份文件(即私钥文件)
  • -p<端口> 指定远程服务器上的端口

    三、实例

    ```shell [root@localhost ~]# ssh 192.168.11.102 Last login: Fri Jun 17 16:44:10 2022 from 192.168.11.101
  1. ```shell
  2. [root@localhost ~]# ssh -i root 192.168.11.102
  3. Warning: Identity file 22 not accessible: No such file or directory.
  4. Last login: Fri Jun 17 21:46:35 2022 from 192.168.11.101
  1. [root@localhost ~]# ssh -p 22 -i root 192.168.11.102
  2. Warning: Identity file root not accessible: No such file or directory.
  3. Last login: Fri Jun 17 21:47:41 2022 from 192.168.11.101