---
name: "ssh-import-id"
section: "1"
platform: "linux"
package: "ssh-import-id"
version: "5.10-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/ssh-import-id"
---

# ssh-import-id(1)

retrieve one or more public keys from a public keyserver and append them to the current user's authorized\_keys file (or some other specified file)

## NAME

**ssh-import-id** - retrieve one or more public keys from a public keyserver and append them to the current user's authorized\_keys file (or some other specified file)

## SYNOPSIS

**ssh-import-id \[options\] USER\_ID\_1 \[gh:USER\_ID\_2\] ... \[lp:USER\_ID\_n\]**

**ssh-import-id-lp USER\_ID\_1 \[USER\_ID\_2\] ... \[USER\_ID\_n\]**

**ssh-import-id-gh USER\_ID\_1 \[USER\_ID\_2\] ... \[USER\_ID\_n\]**

## OPTIONS

 \-h \| --help		usage\
  \-o \| --output F	write output to file 'F' (default ~/.ssh/authorized\_keys, use "-" for standard out)\
  \-r \| --remove  	remove keys from authorized keys file 'F'\
  \-u \| --useragent U	append U to the user agent string\
  PROTO:USER\_ID		Protocol can be 'lp' for Launchpad.net, or 'gh' for Github.com

## DESCRIPTION

This utility will securely contact a public keyserver and retrieve one or more user's public keys, and append these to the current user's *~/.ssh/authorized\_keys* file, standard output or any other specified output file.

User IDs can be prepended by a protocol:

 \- **lp:** to use *https://launchpad.net/~%s/+sshkeys*\
  \- **gh:** to use *https://api.github.com/users/%s/keys*

If the protocol is not explicitly specified, then **ssh-import-id** will read a URL variable string from */etc/ssh/ssh\_import\_id* as installed by your package manager and configured by your system administrator.  You can override this locally by exporting the string you want in a URL environment variable.  If all of these are empty, then the protocol is assumed to be "lp:", which was the original target implementation of this tool.

Any keys added will be "labled" with a trailing comment, "# ssh-import-id PROTO:USER\_ID".  Revoking keys will first look for lines in the authorized keys file ending with that label.

## SEE ALSO

[*ssh*(1)](/ssh/1.md)

## FILES

*/etc/ssh/ssh\_import\_id*

## AUTHOR

This manpage and the utility was written by Dustin Kirkland \<dustin.kirkland@gmail.com\> for Ubuntu systems (but may be used by others).  Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 3 published by the Free Software Foundation.

On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.
