git ssb

0+

cel / sslh



Tree: 9bcb2cdd7a920ebc78b59d0b5797d678424aa93a

Files: 9bcb2cdd7a920ebc78b59d0b5797d678424aa93a / README

5988 bytesRaw
1===== sslh -- A ssl/ssh multiplexer. =====
2
3sslh accepts connections in HTTP, HTTPS, SSH, OpenVPN,
4tinc, XMPP, or any other protocol that can be tested using a
5regular expression, on the same port. This makes it possible
6to connect to any of these servers on port 443 (e.g. from
7inside a corporate firewall, which almost never block port
8443) while still serving HTTPS on that port.
9
10
11==== Compile and install ====
12
13If you're lucky, the Makefile will work for you:
14
15make install
16
17There are a couple of configuration options at the beginning
18of the Makefile:
19
20 USELIBWRAP compiles support for host access control (see
21 hosts_access(3)), you will need libwrap headers and
22 library to compile (libwrap0-dev in Debian).
23
24 USELIBCONFIG compiles support for the configuration
25 file. You will need libconfig headers to compile
26 (libconfig8-dev in Debian).
27
28The Makefile produces two different executables: sslh-fork
29and sslh-select.
30
31sslh-fork forks a new process for each incoming connection.
32It is well-tested and very reliable, but incurs the overhead
33of many processes. sslh-select uses only one thread, which
34monitors all connections at once. It is more recent and less
35tested, but only incurs a 16 byte overhead per connection.
36Also, if it stops, you'll lose all connections, which means
37you can't upgrade it remotely.
38
39If you are going to use sslh for a "small" setup (less than
40a dozen ssh connections and a low-traffic https server) then
41sslh-fork is probably more suited for you. If you are going
42to use sslh on a "medium" setup (a few thousand ssh
43connections, and another few thousand sslh connections),
44sslh-select will be better. If you have a very large site
45(tens of thousands of connections), you'll need a vapourware
46version that would use libevent or something like that.
47
48
49To install:
50
51make
52cp sslh-fork /usr/local/sbin/sslh
53cp scripts/etc.default.sslh /etc/default/sslh
54
55For Debian:
56cp scripts/etc.init.d.sslh /etc/init.d/sslh
57For CentOS:
58cp scripts/etc.rc.d.init.d.sslh /etc/rc.d/init.d/sslh
59
60and probably create links in /etc/rc<x>.d so that the server
61start automatically at boot-up, e.g. under Debian:
62update-rc.d sslh defaults
63
64
65
66==== Configuration ====
67
68You can edit settings in /etc/default/sslh:
69
70LISTEN=ifname:443
71SSH=localhost:22
72SSL=localhost:443
73
74A good scheme is to use the external name of the machine in
75$LISTEN, and bind httpd to localhost:443 (instead of all
76binding to all interfaces): that way, https connections
77coming from inside your network don't need to go through
78sslh, and sslh is only there as a frontal for connections
79coming from the internet.
80
81Note that 'external name' in this context refers to the
82actual IP address of the machine as seen from your network,
83i.e. that that is not 127.0.0.1 in the output of
84ifconfig(8).
85
86==== Libwrap support ====
87
88Sslh can optionnaly perform libwrap checks for the sshd
89service: because the connection to sshd will be coming
90locally from sslh, sshd cannot determine the IP of the
91client.
92
93==== OpenVPN support ====
94
95OpenVPN clients connecting to OpenVPN running with
96-port-share reportedly take more than one second between
97the time the TCP connexion is established and the time they
98send the first data packet. This results in sslh with
99default settings timing out and assuming an SSH connexion.
100To support OpenVPN connexions reliably, it is necessary to
101increase sslh's timeout to 5 seconds.
102
103Instead of using OpenVPN's port sharing, it is more reliable
104to use sslh's -o option to get sslh to do the port sharing.
105
106==== Using proxytunnel with sslh ====
107
108If you are connecting through a proxy that checks that the
109outgoing connection really is SSL and rejects SSH, you can
110encapsulate all your traffic in SSL using proxytunnel (this
111should work with corkscrew as well). On the server side you
112receive the traffic with stunnel to decapsulate SSL, then
113pipe through sslh to switch HTTP on one side and SSL on the
114other.
115
116In that case, you end up with something like this:
117
118ssh -> proxytunnel -e --------ssh/ssl------> stunnel ---ssh---> sslh --> sshd
119
120Web browser --------http/ssl------> stunnel ---http---> sslh --> http:80
121
122Configuration goes like this:
123
124On the server side, using stunnel3:
125stunnel -f -p mycert.pem -d thelonious:443 -l /usr/local/sbin/sslh -- sslh -i --ssl localhost:80 --ssh localhost:22
126
127stunnel options: -f for foreground/debugging, -p specifies
128the key + certificate, -d specifies which interface and port
129we're listening to for incoming connexions, -l summons sslh
130in inetd mode.
131
132sslh options: -i for inetd mode, --ssl to forward SSL
133connexions (in fact normal HTTP at that stage) to port 80,
134and SSH connexions to port 22. This works because sslh
135considers that any protocol it doesn't recognise is SSL.
136
137==== IP_TPROXY support ====
138
139There is a netfilter patch that adds an option to the Linux
140TCP/IP stack to allow a program to set the source address
141of an IP packet that it sends. This could let sslh set the
142address of packets to that of the actual client, so that
143sshd would see and log the IP address of the client, making
144sslh transparent.
145
146This is not, and won't be, implemented in sslh for the
147following reasons (in increasing order of importance):
148
149 * It's not vital: the real connecting IP address can be
150 found in logs. Little gain.
151 * It's Linux only: it means increased complexity for no
152 gain to some users.
153 * It's a patch: it means it'd only be useful to Linux
154 users who compile their own kernel.
155 * Only root can use the feature: that's a definite no-no.
156 Sslh should not, must not, will never run as root.
157
158This isn't to mean that it won't eventually get implemented,
159when/if the feature finds its way into the main kernel and
160it becomes usuable by non-root processes.
161
162
163==== Comments? Questions? ====
164
165You can subscribe to the sslh mailing list here:
166http://rutschle.net/cgi-bin/mailman/listinfo/sslh
167
168This mailing list should be used for discussion, feature
169requests, and will be the prefered channel for
170announcements.
171
172

Built with git-ssb-web