【多选题】
A imp rt paramikClient = paramik .client.SSHClient()Client. c nnect(h stname='192.168. 1.1',username =’ huawei’ ,passw rd=’123456')Stdin,std ut,stderr=client.exec_c mmand('display mem ry’)Print(std ut)Client.cl se()
B imp rt paramikClient = paramik .Transp rt((‘ 192.168,1.1’ ,22)Client. connect(username=’ huawei’,passw rd=’123456’)Cli =client.inv ker_she11()Cli.send(‘ display mem rry
’)Dis =c1li.recv(999999).dec de()Cli.cl se()
C imp rt paramikClient = paramik . Transp rt((‘192.168.1.1’,22)Client. connect(username=’ huawei’,passw rd=’123456’)Stdin,std ut,stderr=client.exec_c mmand('display mem ry’)Result=std ut.resd()F r linein result:Print(line)Ssh.cl se()
D imp rt paramikClient = paramik .client.SSHClient()Client. c nnect(h stname='192.168. 1.1',username =’ huawei’ ,passw rd=’123456')Cli =client.inv ker_she11()Cli.send(‘ display mem rry
’)Dis =c1li.recv(999999).dec de()Print(dis)Cli.cl se()
查看更多