]> andersk Git - gssapi-openssh.git/blame - openssh/README.privsep
Merge from OPENSSH_3_8_1P1_GSSAPI_20040713 to OPENSSH_3_9P1_GSSAPI_20040818.
[gssapi-openssh.git] / openssh / README.privsep
CommitLineData
ff2d7a98 1Privilege separation, or privsep, is method in OpenSSH by which
2operations that require root privilege are performed by a separate
3privileged monitor process. Its purpose is to prevent privilege
416fd2a8 4escalation by containing corruption to an unprivileged process.
ff2d7a98 5More information is available at:
2980ea68 6 http://www.citi.umich.edu/u/provos/ssh/privsep.html
7
ff2d7a98 8Privilege separation is now enabled by default; see the
9UsePrivilegeSeparation option in sshd_config(5).
2980ea68 10
416fd2a8 11On systems which lack mmap or anonymous (MAP_ANON) memory mapping,
12compression must be disabled in order for privilege separation to
ff2d7a98 13function.
14
15When privsep is enabled, during the pre-authentication phase sshd will
2980ea68 16chroot(2) to "/var/empty" and change its privileges to the "sshd" user
ff2d7a98 17and its primary group. sshd is a pseudo-account that should not be
18used by other daemons, and must be locked and should contain a
19"nologin" or invalid shell.
20
21You should do something like the following to prepare the privsep
22preauth environment:
2980ea68 23
24 # mkdir /var/empty
25 # chown root:sys /var/empty
26 # chmod 755 /var/empty
27 # groupadd sshd
ff2d7a98 28 # useradd -g sshd -c 'sshd privsep' -d /var/empty -s /bin/false sshd
2980ea68 29
30/var/empty should not contain any files.
31
32configure supports the following options to change the default
33privsep user and chroot directory:
34
35 --with-privsep-path=xxx Path for privilege separation chroot
36 --with-privsep-user=user Specify non-privileged user for privilege separation
37
ff2d7a98 38Privsep requires operating system support for file descriptor passing.
39Compression will be disabled on systems without a working mmap MAP_ANON.
2980ea68 40
416fd2a8 41PAM-enabled OpenSSH is known to function with privsep on Linux.
ff2d7a98 42It does not function on HP-UX with a trusted system
416fd2a8 43configuration.
2980ea68 44
1b56ff3d 45On Cygwin, Tru64 Unix, OpenServer, and Unicos only the pre-authentication
46part of privsep is supported. Post-authentication privsep is disabled
47automatically (so you won't see the additional process mentioned below).
1c14df9e 48
2980ea68 49Note that for a normal interactive login with a shell, enabling privsep
50will require 1 additional process per login session.
51
52Given the following process listing (from HP-UX):
53
54 UID PID PPID C STIME TTY TIME COMMAND
55 root 1005 1 0 10:45:17 ? 0:08 /opt/openssh/sbin/sshd -u0
56 root 6917 1005 0 15:19:16 ? 0:00 sshd: stevesk [priv]
57 stevesk 6919 6917 0 15:19:17 ? 0:03 sshd: stevesk@2
58 stevesk 6921 6919 0 15:19:17 pts/2 0:00 -bash
59
60process 1005 is the sshd process listening for new connections.
61process 6917 is the privileged monitor process, 6919 is the user owned
62sshd process and 6921 is the shell process.
63
64$Id$
This page took 0.066924 seconds and 5 git commands to generate.