pgbezerra / rpw

Cache your sudo / become password in your shell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rpw Build Status

This is a Haskell implementation of cache-pw.

How to install

You need Stack.

$ stack install

How to use

$ rpw bash
$ sudo echo hello!
[sudo] password for foobar: (rpw..sudo) <-        # type your password and
                                                  # end with `Enter`, `C-j` or `C-m`
hello!
$ sudo -k
$ sudo echo hello!
[sudo] password for foobar: <- (rpw..cached)      # no need to type here!
hello!
$ ansible-playbook playbook.yml -K
SUDO password: <- (rpw..cached)                   # no need to type here!
 _____________________
< PLAY [Some playbook!] >
 ---------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

Testing

You need docker and docker-compose for this:

make test

TODO

  • Allow resetting the password without exiting the shell.
  • Emit SIGWINCH to the slave terminal when needed.

About

Cache your sudo / become password in your shell

License:GNU General Public License v3.0


Languages

Language:Haskell 77.9%Language:Python 12.1%Language:Shell 7.2%Language:Makefile 2.4%Language:Dockerfile 0.3%