Skip to content

Quickly share curlable links to your SSH pub keys (from agent,github,file,raw) 🔑

License

Notifications You must be signed in to change notification settings

WillFantom/sshare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SSHare    GitHub release (latest SemVer)  GitHub Workflow Status

Quickly share SSH keys from your agent as curlable links! Use the sshare TUI to easily select keys from an SSH agent and automatically generate a transfer.sh upload that can easily be added to an authorized key file via curl.


Install

  • Linux
    • Download the appropriate version for your system from the GitHub release page
    • Move the sshare binary to a directory in your PATH
  • MacOS
    • Download and install via Homebrew:
      brew install willfantom/tap/sshare
      

Usage

Simply run: sshare

Sensible defaults are used, such as connecting to the SSH agent as defined by the SSH_AUTH_SOCK environment variable.

  • To include keys that are not found in your agent, you can specify a file containing the public key with the -f flag (and can be specified multiple times):

    sshare -f ~/.ssh/id_rsa.pub
    
  • An SSH agent socket path other than the one found in SSH_AUTH_SOCK can be provided using the -a flag:

    sshare -a /tmp/ssh-XXXXXXanCbmG/agent.8
    
  • Add keys from a generated link to an authorized_keys file:

    curl --fail-with-body <downloadURL> >> ~/.ssh/authorized_keys
    
  • Uploads can be deleted by either:

    • Opening the downloaded link in a browser and deleting the key using the given deletion code
    • By running the delete command of sshare:
      sshare delete <downloadURL> <deletionCode>
      
    • Or by running:
      curl -X DELETE <downloadURL>/<deletionCode>
      
  • Also provide your GitHub SSH keys as options for keys to share:

    sshare -g "<a github access token with read ssh keys permission>"
    

Share your public SSH keys found in your agent via curl-able transfer.sh links.

Usage:
  sshare [flags]
  sshare [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  delete      Delete an uploaded authorized_keys file
  help        Help about any command

Flags:
  -a, --agent string           path to the target ssh agent socket ($SSH_AUTH_SOCK) (default "~/.1password/agent.sock")
  -g, --github-token string    github token with permission to read ssh keys
  -h, --help                   help for sshare
  -k, --key stringArray        additional keys to include in the generated authorized_keys
  -f, --key-file stringArray   additional key file(s) to include in the generated authorized_keys
  -d, --max-days int           number of days that the content will remain available via transfer.sh (default 2)
  -m, --max-downloads int      maximum number of times any content shared can be downloaded (default 10)
  -p, --passphrase string      passphrase for the ssh agent

Use "sshare [command] --help" for more information about a command.