Skip to content
/ rpw Public

Cache your sudo / become password in your shell

License

Notifications You must be signed in to change notification settings

thalesmg/rpw

Repository files navigation

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.