Giter Site home page Giter Site logo

vpnautoflush's Introduction

ubuntu14.04 Network-Manager VPN批量添加账号的脚本

  1. 程序流程:

    • 先爬取vpn信息主页(主页内容是文本)
    • 解析文本文件,将其结构化,将其中的代理网关ip按照"PPTP-L2TP", "PPTP"等分类
    • 保存一份VPN配置文件的模板到本地,将上述网关ip组装成配置文件放到指定目录(/etc/NetworkManager/system-connections/)下
    • 修改文件的权限为600, 然后重启NM服务,就可以在系统右上角的vpn列表中看见添加的账号
  2. 程序的使用:

    • 脚本需要三个参数vpn的账户名和密码,以及主机的root密码(写文件到系统目录需要root权限)

        python vpnFresh.py vpn_username vpn_pwd host_root_pwd
      
    • 需要改进: 将root密码的输入设成可选,可以让用户以root身份运行程序,这样避免root密码泄露的风险

vpnautoflush's People

Contributors

david-webb avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.