A small CLI wrapper for authenticating with SSH keys from Hashicorp Vault
vaultssh is a small CLI wrapper for automatically fetching and using signed SSH certificates when remoting into a host. It wraps the ssh process and is therefore compatible with all standard ssh flags.
cargo install vaultssh
``` $> vssh --help
vaultssh 0.1.0
A small CLI wrapper for authenticating with SSH keys from Hashicorp Vault
USAGE:
vssh [FLAGS] [OPTIONS]
ARGS:
FLAGS: -b, --basic disables terminal effects -h, --help Print help information -p, --persist persist acquired tokens to ~/.vault-token -V, --version Print version information
OPTIONS:
-a, --auth-method
A configuration can be used by either creating it at ~/.vssh
or passing one in
using the CLI option. Configuration files are in TOML format. An example one is
shown below:
```toml
#
auth = "oidc" # default authentication method to use authmount = "oidc" # default mount point for the authentication method identity = "~/.ssh/idrsa" # ssh key-pair to sign and use mount = "ssh" # mount path for ssh backend persist = true # persist acquired tokens to ~/.vault-token role = "myrole" # vault role account to sign with server = "https://vault:8200" # address of vault server
[approle] # name of auth method to configure role_id = "myrole" # default values for auth method
[oidc] role = "admin
[userpass] username = "myuser" ```
The following occurs when you run vssh:
By default, if a new certificate is needed but no valid token has been found
then vssh will initiate a login prompt for acquiring a new token. This token
will only be used for the single session unless the --persist
option is given
in which case the token is saved to the Vault CLI's default location of
~/.vault-token
. Future uses of vssh will use this token.
Not all authentication methods are currently supported, see the above configuration example for the ones that are. Specifying defaults for the authentication method will pre-fill the login prompt to make logging in easier. However, all other auth methods are still available if desired (i.e. setting defaults does not skip any prompts).
Check out the issues for items neeeding attention or submit your own and then: