试题详情

SSH服务器已配置完成且正确,SSH客户端运行以下哪些 Python代码可以成功建立SSH连接(私钥文件为id_rsa,与客户端 Python脚本处于同路径下)?

A

import paramiko

client=paramiko.client.SSHClient()

client.connect(hostname='192.168.1.1',username='huawei',key_filename='id_rsa')

B

import paramiko

client=paramiko.client.SSHClient()

client.connect(hostname='192.168.1.1',username='huawei',pkey='id_rsa')

C

import paramiko

client=paramiko.Transport(('192.168.1.1',22))

client.connect(username='huawei',key_filename='id_rsa')

D

import paramiko

key=parmiko.RSAKey.from_private_key_file('id_rsa')

client=paramiko.Transport(('192.168.1.1',22))

client.connect(username='huawei',pkey='id_rsa')