|
1 | | -# pass ssh |
| 1 | +# pass ssh 0.1 [![build status][build-img]][build-url] |
| 2 | + |
| 3 | +A [pass](https://www.passwordstore.org/) extension that lets you quickly |
| 4 | +create ssh keypairs and output public keys using |
| 5 | +[fzf](https://github.com/junegunn/fzf) or |
| 6 | +[rofi](https://davedavenport.github.io/rofi/). |
| 7 | + |
| 8 | + |
| 9 | +## Usage |
| 10 | + |
| 11 | +``` |
| 12 | +pass ssh [--help,-h] |
| 13 | + [--fzf,-f]|[--rofi,-r] [--ssh-dir <s>,-d <s>] |
| 14 | + [--pass-prefix <s>,-p <s>] [--passphrase-no-symbols,-n] [--passphrase-length <s>,-l <s>] |
| 15 | + [--ssh-t <s>] [--ssh-b <s>] |
| 16 | +``` |
| 17 | + |
| 18 | +`pass-ssh` provides an interactive solution to create ssh private |
| 19 | +and public keypairs with passphrases stored in `pass` as well as |
| 20 | +write the public key to stdout. It will show all available ssh keys in |
| 21 | +either `fzf` or `rofi`, wait for the user to select one and |
| 22 | +write the public key to stdout. |
| 23 | + |
| 24 | +The user can select `fzf` or `rofi` by giving either `--fzf` |
| 25 | +or `--rofi`. By default, `rofi` will be selected and |
| 26 | +`pass-ssh` will fallback to `fzf`. |
| 27 | + |
| 28 | +If the selected key file does not exist under the directory given by |
| 29 | +`--ssh-dir`, first a passphrase will be generated in `pass` |
| 30 | +under the prefix given by `--pass-prefix`. Specific passphrase |
| 31 | +length can be given using `--passphrase-length` and no symbols can |
| 32 | +be activated with `--passphrase-no-symbols`. Second, a new private |
| 33 | +and public keypair will be generated with the aforementioned passphrase |
| 34 | +and with `ssh-keygen`'s `-t` and `-b` option given |
| 35 | +respectively by `--ssh-t` and `--ssh-b`. Lastly, the public key |
| 36 | +is written to stdout. |
| 37 | + |
| 38 | +If the selected key exists, the public key is simply written to stdout. |
| 39 | + |
| 40 | + |
| 41 | +## Options |
| 42 | +* `-f`, `--fzf` Use fzf to select pass-name. |
| 43 | +* `-r`, `--rofi` Use rofi to select pass-name. |
| 44 | +* `-d`, `--ssh-dir` Directory holding ssh keyfiles, default $HOME/.ssh. |
| 45 | +* `-p`, `--pass-prefix` Prefix under which passphrase are stored in pass, default sshkey-passphrase. |
| 46 | +* `-n`, `--no-symbols` Do not use any non-alphanumeric characters. |
| 47 | +* `-l <size>`, `--length=<size>` Provide a password length. |
| 48 | +* `--ssh-t` ssh-keygen's -t option, the type of key to create. |
| 49 | +* `--ssh-b` ssh-keygen's -b option, the number of bits in the key to create. |
| 50 | +* `-h`, `--help` Show usage message. |
| 51 | + |
| 52 | + |
| 53 | +## Examples |
| 54 | + |
| 55 | +Combined with a clipboard manager like [`xclip`](https://github.com/astrand/xclip): |
| 56 | +``` |
| 57 | +pass ssh | xclip -in -selection clipboard |
| 58 | +``` |
| 59 | + |
| 60 | + |
| 61 | +## Installation |
| 62 | + |
| 63 | + |
| 64 | +### ArchLinux |
| 65 | + |
| 66 | +```sh |
| 67 | +pacaur -S pass-ssh |
| 68 | +``` |
| 69 | + |
| 70 | + |
| 71 | +### Other linuxes |
| 72 | + |
| 73 | +```sh |
| 74 | +git clone https://github.com/ibizaman/pass-ssh/ |
| 75 | +cd pass-ssh |
| 76 | +sudo make install |
| 77 | +``` |
| 78 | + |
| 79 | + |
| 80 | +### Requirements |
| 81 | + |
| 82 | +* `pass 1.7.0` or greater. |
| 83 | +* If you do not want to install this extension as system extension, you need to |
| 84 | +enable user extension with `PASSWORD_STORE_ENABLE_EXTENSIONS=true pass`. You can |
| 85 | +create an alias in `.bashrc`: `alias pass='PASSWORD_STORE_ENABLE_EXTENSIONS=true pass'` |
| 86 | + |
| 87 | + |
| 88 | +## Contribution |
| 89 | + |
| 90 | +Feedback, contributors, pull requests are all very welcome. |
| 91 | + |
| 92 | + |
| 93 | +## Acknowledgments |
| 94 | + |
| 95 | +Thanks to [roddhjav](https://github.com/roddhjav) for creating |
| 96 | +[pass-update](https://github.com/roddhjav/pass-update) from which this |
| 97 | +script is heavily inspired. |
| 98 | + |
| 99 | + |
| 100 | +## License |
| 101 | + |
| 102 | +``` |
| 103 | +Copyright (C) 2017 Pierre PENNINCKX |
| 104 | +
|
| 105 | +This program is free software: you can redistribute it and/or modify |
| 106 | +it under the terms of the GNU General Public License as published by |
| 107 | +the Free Software Foundation, either version 3 of the License, or |
| 108 | +(at your option) any later version. |
| 109 | +
|
| 110 | +This program is distributed in the hope that it will be useful, |
| 111 | +but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 112 | +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 113 | +GNU General Public License for more details. |
| 114 | +
|
| 115 | +You should have received a copy of the GNU General Public License |
| 116 | +along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 117 | +``` |
| 118 | + |
| 119 | +[build-img]: https://travis-ci.org/ibizaman/pass-ssh.svg?branch=master |
| 120 | +[build-url]: https://travis-ci.org/ibizaman/pass-ssh |
0 commit comments