{"id":15055506,"url":"https://github.com/jirutka/ssh-getkey-gitlab","last_synced_at":"2025-04-10T03:52:15.950Z","repository":{"id":65605261,"uuid":"183052332","full_name":"jirutka/ssh-getkey-gitlab","owner":"jirutka","description":"A simple script to be used as AuthorizedKeysCommand in OpenSSH server to look up user’s public keys in GitLab or GitHub.","archived":false,"fork":false,"pushed_at":"2022-09-09T15:59:17.000Z","size":8,"stargazers_count":21,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-01T00:15:15.830Z","etag":null,"topics":["authentication","gitlab","openssh","shell","ssh","ssh-key"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jirutka.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-23T16:13:51.000Z","updated_at":"2025-02-26T12:43:22.000Z","dependencies_parsed_at":"2023-01-31T12:10:12.669Z","dependency_job_id":null,"html_url":"https://github.com/jirutka/ssh-getkey-gitlab","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jirutka%2Fssh-getkey-gitlab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jirutka%2Fssh-getkey-gitlab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jirutka%2Fssh-getkey-gitlab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jirutka%2Fssh-getkey-gitlab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jirutka","download_url":"https://codeload.github.com/jirutka/ssh-getkey-gitlab/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266570,"owners_count":20910837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","gitlab","openssh","shell","ssh","ssh-key"],"created_at":"2024-09-24T21:43:29.494Z","updated_at":"2025-04-10T03:52:15.931Z","avatar_url":"https://github.com/jirutka.png","language":"Shell","readme":"= OpenSSH, look up public keys in GitLab!\n:name: ssh-getkey-gitlab\n:version: 0.2.0\n:gh-name: jirutka/{name}\n:script-name: {name}\n:cfgfile-name: getkey-gitlab.conf\n:file-uri: https://raw.githubusercontent.com/{gh-name}/v{version}\n\nThis project provides a simple script to be used as `AuthorizedKeysCommand` in OpenSSH server to fetch authorized keys from GitLab or GitHub.\nThe script stores the fetched keys in a cache directory and automatically fallbacks to the cached keys in case of network or GitLab failure.\nIt’s written in POSIX shell and requires just one dependency: wget (both GNU and Busybox wget are supported).\n\n\n== Requirements\n\n* http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html[POSIX-sh] compatible shell (e.g. Busybox ash, dash, ZSH, bash, …)\n* `wget` (GNU or Busybox)\n\n\n== Installation\n\n=== Using git and make\n\n[source, sh, subs=\"verbatim, attributes\"]\n----\ngit clone -b v{version} https://github.com/{gh-name}.git\ncd {name}\nmake install\n----\n\nStandard GNU Makefile variables such as `DESTDIR`, `prefix`, `sbindir`… are supported.\n\n\n=== Manual\n\n[source, sh, subs=\"verbatim, attributes\"]\n----\ncd /usr/local/sbin\nwget {file-uri}/{script-name}\nchown root:root {script-name}\nchmod 0755 {script-name}\n\ncd /etc/ssh\nwget {file-uri}/{cfgfile-name}\nchown root:root {cfgfile-name}\nchmod 0644 {cfgfile-name}\nvim {cfgfile-name}  # read next section\n\ninstall -m 700 -o sshd -g nogroup -d /var/cache/ssh-getkey-gitlab\n----\n\n\n== Configuration\n\nThe script reads configuration from `/etc/ssh/{cfgfile-name}`.\n\nThe file format is a shell script.\nThe configuration variables are as follows:\n\ngitlab_url::\n  The base URL of the GitLab instance to fetch the keys from.\n\nminimum_uid::\n  Ignore users with UID lower than the specified number.\n  Default is 1000.\n\ntimeout::\n  The network timeout in seconds.\n  Default is 5.\n\ncache_dir::\n  Path of directory where to store fetched SSH keys.\n  Default is `/var/cache/ssh-getkey-gitlab`.\n\n\n== Setup OpenSSH server\n\nTo configure OpenSSH server to fetch users’ authorized keys from GitLab server:\n\n. Make sure that you have installed `{script-name}` in `/usr/local/sbin` (or `/usr/sbin`) with owner `root` and mode `0755`.\n. Add these two lines into `/etc/ssh/sshd_config`:\n+\n[source, subs=\"verbatim, attributes\"]\n----\nAuthorizedKeysCommand /usr/local/sbin/{script-name}\nAuthorizedKeysCommandUser sshd\n----\n\n. Restart sshd and check log file if there’s no problem.\n\nNote: This method is supported by OpenSSH since version 6.2-p1 (or 5.3 onRedHat).\n\n\n== License\n\nThis project is licensed under http://opensource.org/licenses/MIT[MIT License].\nFor the full text of the license, see the link:LICENSE[LICENSE] file.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjirutka%2Fssh-getkey-gitlab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjirutka%2Fssh-getkey-gitlab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjirutka%2Fssh-getkey-gitlab/lists"}