Code Monkey home page Code Monkey logo

pykmux's Introduction

pyKmux

License

A small and simple python script to automatically renew a kerberos ticket in a tmux session. The kinit password prompt and password are encrypted and individually stored in a file, whereas the encryption key is stored seperately in a different file, both at paths specified by the user. The passwords and path need to be specified whenever they are not available during runtime of the script, ie. whenever the .paths file eg. does not exist (anymore), the user needs to specify the paths again. The same applies for missing kinit password prompt or password. Every key will be used only once, ie. after a successful ticket renewal, a new key will be generated, the password prompt and password encrypted using the new key and stored accordingly.

Installation

  • Clone the pyKmux repository
  • Navigate to the project root (where pykmux.py lives)
  • Execute pip install -r requirements.txt to install all required packages
  • Execute kinit in your terminal and copy the entire password prompt

Initialization/First use:

  • Open the terminal (or tmux session) and execute python pykmux.py once.
  • Follow the instructions by answering the prompts:
    • Where to store the encrypted prompt and password (visible when typing)
    • Where to store the encryption key (visible when typing)
    • The kinit password prompt (visible when typing)
    • The password to connect with, the one that is necessary to renew the ticket (not visible when typing)

Note: Perform this initialization step before the watch -n <time> <"command"> command shown below since the user interaction for the initialization does not work when using the watch command. The initialization step is important to set everything correctly for an automated renewal of a kerberos ticket afterwards. The initialization step always applies when relevant/some information is removed/deleted. Once the initialization is done, the script can be automatically executed given a specified time as follows.

How to execute the script with watch -n <time> <"command">

  • Create or attach to a tmux session: tmux new -s <session_name> or tmux a -t <session_name>
  • Execute python pykmux.py every 5 hours: watch -n 18000 "python pykmux.py"

pykmux's People

Contributors

amrane99 avatar karol-g 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.