auberge ssh add-key
Authorize an SSH public key on a remote host’s ~/.ssh/authorized_keys. Alias: auberge ss ak.
auberge ssh add-key [OPTIONS]Requires existing SSH access to the target. Creates ~/.ssh (700) if absent and sets authorized_keys to 600.
Options
Section titled “Options”| Option | Description | Default |
|---|---|---|
-H, --host HOST |
Target host | Interactive |
-c, --connect-with KEY |
Private key to connect with | Interactive |
-a, --authorize KEY |
Public key (.pub) to authorize |
Interactive |
-u, --user USER |
Remote user | ansible |
-y, --yes |
Skip confirmation | false |
Both key options scan ~/.ssh/identities/<host>/, ~/.ssh/identities/ and ~/.ssh/ when prompting interactively.
Examples
Section titled “Examples”auberge ssh add-key --host myserver --authorize ~/.ssh/identities/myserver/ansible.pub# key rotation: connect with old, authorize newauberge ssh add-key --host myserver \ --connect-with ~/.ssh/identities/myserver/ansible-old \ --authorize ~/.ssh/identities/myserver/ansible.pub# different remote userauberge ssh add-key --host myserver --user deploy --authorize ~/.ssh/identities/myserver/deploy.pubGotchas
Section titled “Gotchas”- Adding a key that is already authorized is safe — SSH ignores duplicates.
- For a fresh VPS where only root has access, use
ssh-copy-id -i <key>.pub root@<ip>first, then runauberge ansible bootstrapto create the ansible user before using this command.