https://github.com/thalesmg/rpw
Cache your sudo / become password in your shell
https://github.com/thalesmg/rpw
expect haskell password rpw shell sudo
Last synced: 7 months ago
JSON representation
Cache your sudo / become password in your shell
- Host: GitHub
- URL: https://github.com/thalesmg/rpw
- Owner: thalesmg
- License: gpl-3.0
- Created: 2019-02-04T11:59:11.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-01-31T18:43:12.000Z (about 5 years ago)
- Last Synced: 2025-04-02T21:14:26.851Z (10 months ago)
- Topics: expect, haskell, password, rpw, shell, sudo
- Language: Haskell
- Homepage:
- Size: 121 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: LICENSE
Awesome Lists containing this project
README
# rpw [](https://travis-ci.org/thalesmg/rpw)
This is a Haskell implementation of [`cache-pw`](https://gitlab.com/dgvncsz0f/dot/blob/master/roles/bash/files/bin/cache-pw).

## How to install
You need [Stack](https://docs.haskellstack.org/en/stable/README/).
```bash
$ stack install
```
## How to use
```bash
$ 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:
```bash
make test
```
## TODO
- [ ] Allow resetting the password without exiting the shell.
- [ ] Emit `SIGWINCH` to the slave terminal when needed.