git ssb

0+

cel / sslh



Tree: 5cd1fa18753c479f7eaef26b893016a37646364f

Files: 5cd1fa18753c479f7eaef26b893016a37646364f / README

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

Built with git-ssb-web