In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Paramiko is a Python wrapper that implements ssh3 remote secure connections. Support authentication and key mode, can realize remote command execution, file transmission and other functions, compared with pexpect encapsulation level higher security.
1. Paramiko installation
paramiko relies on third-party Ecdsa,Crypto and Python development kits pyhton-devel
Error: command 'gcc' failed with exit status 1 appears when installation appears because there is no Python development kit.
Paramiko has two core classes SSHClient and SFTPClient.
SSHClient is a high-level representation of an SSH server session that encapsulates the transport, channel, and verification and establishment methods of SFTPClient.
2.1>Connect method
connect(self,hostname,port=22,username=None,password=None,pkey=None,key_filename=None,timeout=None,allow_agent=True,look_for_keys=True,compress=False)
pkey: private key method is used for authentication;key_filename is a file name or list of file names used for authentication of private key;allow_agent is set to False to disable linking to ssh proxy;look_for_keys is False to disable searching for private key files in ~/.ssh; compression is turned on when compression is True.
2.2>exec_command
exec_command(self,command,bufsize=-1)
2.3>load_system_host_keys
Load local public key verification file, default is ~/.ssh/known_hosts
load_system_host_keys(self,filename=Noe)
2.4>set_missing_host_key_policy
Set the policy when the connected remote host has no local host key or HostKeys object. Currently, three policies are supported: AutoAddPolicy,RejectPolicy,WarningPolicy.
AutoAddPolicy: Automatically adds host names and host keys to the local HostKeys object and saves them, independent of the configuration of load_system_host_keys()
RejectPolicy: Automatically rejects unknown hostnames and keys, depending on the configuration of load_system_host_keys()
WarningPolicy: A Python warning that logs an unknown host key and accepts it, similar to AutoAddPolicy except that unknown hosts have warning messages.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.