README.privsep 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. Privilege separation, or privsep, is method in OpenSSH by which
  2. operations that require root privilege are performed by a separate
  3. privileged monitor process. Its purpose is to prevent privilege
  4. escalation by containing corruption to an unprivileged process.
  5. More information is available at:
  6. http://www.citi.umich.edu/u/provos/ssh/privsep.html
  7. Privilege separation is now mandatory. During the pre-authentication
  8. phase sshd will chroot(2) to "/var/empty" and change its privileges to the
  9. "sshd" user and its primary group. sshd is a pseudo-account that should
  10. not be used by other daemons, and must be locked and should contain a
  11. "nologin" or invalid shell.
  12. You should do something like the following to prepare the privsep
  13. preauth environment:
  14. # mkdir /var/empty
  15. # chown root:sys /var/empty
  16. # chmod 755 /var/empty
  17. # groupadd sshd
  18. # useradd -g sshd -c 'sshd privsep' -d /var/empty -s /bin/false sshd
  19. /var/empty should not contain any files.
  20. configure supports the following options to change the default
  21. privsep user and chroot directory:
  22. --with-privsep-path=xxx Path for privilege separation chroot
  23. --with-privsep-user=user Specify non-privileged user for privilege separation
  24. PAM-enabled OpenSSH is known to function with privsep on AIX, FreeBSD,
  25. HP-UX (including Trusted Mode), Linux, NetBSD and Solaris.
  26. On Cygwin, Tru64 Unix and OpenServer only the pre-authentication part
  27. of privsep is supported. Post-authentication privsep is disabled
  28. automatically (so you won't see the additional process mentioned below).
  29. Note that for a normal interactive login with a shell, enabling privsep
  30. will require 1 additional process per login session.
  31. Given the following process listing (from HP-UX):
  32. UID PID PPID C STIME TTY TIME COMMAND
  33. root 1005 1 0 10:45:17 ? 0:08 /opt/openssh/sbin/sshd -u0
  34. root 6917 1005 0 15:19:16 ? 0:00 sshd: stevesk [priv]
  35. stevesk 6919 6917 0 15:19:17 ? 0:03 sshd: stevesk@2
  36. stevesk 6921 6919 0 15:19:17 pts/2 0:00 -bash
  37. process 1005 is the sshd process listening for new connections.
  38. process 6917 is the privileged monitor process, 6919 is the user owned
  39. sshd process and 6921 is the shell process.