Skip to content

Commit 3d254f9

Browse files
committed
updating readme and sponsors
1 parent cb2c32b commit 3d254f9

File tree

2 files changed

+27
-24
lines changed

2 files changed

+27
-24
lines changed

README.md

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,66 @@
11
# sshfront
22

3-
A lightweight SSH server frontend written in Go. Authentication and connections
3+
A lightweight SSH server frontend where authentication and connections
44
are controlled with command handlers / shell scripts.
55

66
## Using sshfront
77
```
88
Usage: ./sshfront [options] <handler>
99
10-
-d=false: debug mode displays handler output
11-
-e=false: pass environment to handlers
12-
-k="": pem file of private keys (read from SSH_PRIVATE_KEYS by default)
13-
-h="": host ip to listen on
10+
-a="": authentication hook. empty=allow all
11+
-d=false: debug mode
12+
-e=false: pass environment to handler
13+
-h="0.0.0.0": ip to listen on
14+
-k="~/.ssh/id_rsa": private host key path
1415
-p="22": port to listen on
1516
```
1617

1718

18-
#### auth-handler $user $key
19+
#### handler $command...
1920

20-
* `$user` argument is the name of the user being used to attempt the connection
21-
* `$key` argument is the public key data being provided for authentication
22-
23-
auth-handler is the path to an executable that's used for authenticating incoming SSH connections. If it returns with exit status 0, the connection will be allowed, otherwise it will be denied. The output of auth-handler must be empty, or key-value pairs in the form `KEY=value` separated by newlines, which will be added to the environment of exec-handler.
21+
* `$command...` command line arguments specified to run by the SSH client
2422

25-
Although auth-handler is required, you can still achieve no-auth open access by providing `/usr/bin/true` as auth-handler.
23+
The handler is a command that's used to handle all SSH connections. Output, stderr, and the exit code is returned to the client. If the client provides stdin, that's passed to the handler.
2624

25+
If the authentication hook was specified, any output is parsed as environment variables and added to the handler environment. `$USER` is always the SSH user used to connect and `$SSH_ORIGINAL_COMMAND` is the command specified from the client if not interactive.
2726

28-
#### exec-handler $command...
27+
#### auth-hook $user $key
2928

30-
* `$command...` arguments is the command line that was specified to run by the SSH client
29+
* `$user` argument is the name of the user being used to attempt the connection
30+
* `$key` argument is the public key data being provided for authentication
3131

32-
exec-handler is the path to an executable that's used to execute the command provided by the client. The meaning of that is quite flexible. All of the stdout and stderr is returned to the client, including the exit status. If the client provides stdin, that's passed to the exec-handler. Any environment variables provided by the auth-handler output will be available to exec-handler, as well as `$USER` and `$SSH_ORIGINAL_COMMAND` environment variables.
32+
The auth hook is a command used for authenticating incoming SSH connections. If it returns with exit status 0, the connection will be allowed, otherwise it will be denied. The output of auth hook must be empty, or key-value pairs in the form `KEY=value` separated by newlines, which will be added to the environment of connection handler.
3333

34+
The auth hook is optional, but if not specified then all connections are allowed.
35+
It is a good idea to always specify an auth hook.
3436

3537
## Examples
3638

37-
**These examples bypass all authentication and allow remote execution, *do not* run this in production.**
39+
**Many of these bypass authentication and may allow remote execution, *do not* run this in production.**
3840

39-
Echo server (with accept-all auth):
41+
Echo server:
4042

4143
```
42-
server$ sshfront $(which true) $(which echo)
44+
server$ sshfront $(which echo)
4345
client$ ssh $SERVER "hello world"
4446
hello world
4547
```
4648

47-
Echo host's environment to clients (with accept-all auth):
49+
Echo host's environment to clients:
4850

4951
```
50-
server$ sshfront -e $(which true) $(env)
52+
server$ sshfront -e $(env)
5153
client$ ssh $SERVER
5254
USER=root
5355
HOME=/root
5456
LANG=en_US.UTF-8
5557
...
5658
```
5759

58-
Bash server (with accept-all auth):
60+
Bash server:
5961

6062
```
61-
server$ sshfront $(which true) $(which bash)
63+
server$ sshfront $(which bash)
6264
client$ ssh $SERVER
6365
bash-4.3$ echo "this is a bash instance running on the server"
6466
this is a bash instance running on the server
@@ -67,8 +69,8 @@ this is a bash instance running on the server
6769

6870
## Sponsors
6971

70-
This project was made possible thanks to [DigitalOcean](http://digitalocean.com).
72+
This project was made possible thanks to [Deis](http://deis.io) and [DigitalOcean](http://digitalocean.com).
7173

7274
## License
7375

74-
BSD
76+
MIT

SPONSORS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
DigitalOcean http://digitalocean.com
1+
DigitalOcean http://digitalocean.com
2+
Deis Project http://deis.io

0 commit comments

Comments
 (0)