Skip to content

renqiang06/pyssh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pyssh

Python version

  • python连接ssh
  • 运行脚本

ssh连接参数 config.json配置:

  • ssh登录参数保存与读取:
import json

my_dict = {"host": "00.00.00.00","port": 22,"user": "root", "pw": "password"}
# 保存文件
tf = open("config.json", "w")
json.dump(my_dict,tf)
tf.close()
# 读取文件
tf = open("config.json", "r")
new_dict = json.load(tf)
print(new_dict)
  • 直接新建 config.json文件,其样式如下:
{
    "host": "00.00.00.00",
    "port": 22,
    "user": "root",
    "pw": "password"
}

About

python连接ssh,运行脚本

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages