blob: eb87175ea8b27be6137cb38e79ea7a7a05310313 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# SSH Auth to Gogs or Github
Small program to call out to a (patched) Gogs server and pull SSH keys
from the API.
This should work for Github as well with the endpoint adjusted.
The main utility of this program is to be used to provide SSH keys to a Unix
server without the need to manually place them on it.
## Installing
```
go get git.stridet.com/Stridet/sshauth
```
```
sudo install -m 555 -o root -g bin $GOPATH/bin/sshauth /usr/local/bin/
```
And then in `/etc/ssh/sshd_config`
```
AuthorizedKeysCommand sshauth -e https://git.stridet.com/api/v1 -u %u
```
See: http://man.openbsd.org/sshd_config#AuthorizedKeysCommand for more
information.
## Gogs Patch
Used on commit `2c3e2b701e012294d457937e6bfbffd63dd8ae4f` it should work
as expected with `git apply` and `go build`
## Notes
This obviously requires that your server have a working internet connection.
Without it it'll just time out and you'll be locked out. This usually isn't
a problem if you're using SSH though.
If you have a highly restrictive firewall you're going to want to be sure to
set up a special user and allow outbound network access.
|