首页 > 技术文章 > paramiko初识

daviddd 2020-03-13 11:31 原文

paramiko初识

用于帮助开发者通过代码远程连接服务器,并对服务器进行操作。

```
pip3 install paramiko 
```

基于xshell连接服务器

  • 用户名和密码

  • 公钥和私钥(rsa)

    • 生成公钥和私钥

      ssh-keygen.exe -m pem
      
      在当前用户家目录会生成: .ssh/id_rsa.pub    .ssh/id_rsa
      
    • 把公钥放到服务器

      ssh-copy-id -i ~.ssh/id_rsa.pub root@192.168.16.85 
      
    • 以后再连接服务器时,不需要在输入密码

      ssh root@192.168.16.85

推荐阅读