<?xml version="1.0"?>
<!DOCTYPE webpage
  PUBLIC "-//NetBSD//DTD Website-based NetBSD Extension//EN"
        "http://www.NetBSD.org/XML/htdocs/lang/share/xml/website-netbsd.dtd">

<webpage id="developers-restricted">
  <config param="desc" value="Developer Restricted Shell Access"/>
  <config param="cvstag" 
    value="$NetBSD: restricted.xml,v 1.5 2010/02/05 16:01:16 spz Exp $"/>
  <config param="rcsdate" value="$Date: 2010/02/05 16:01:16 $"/>
  <head>
    <!-- Copyright (c) 1994-2003
    The NetBSD Foundation, Inc.  ALL RIGHTS RESERVED. -->

    <title>NetBSD Developer Documentation: Developer Restricted 
      Shell Access</title>
  </head>

  <para>For security reasons, developer access on cvs.NetBSD.org has been
    restricted to the following commands:</para>

  <sect1 role="toc">
    <sect2 id="restricted-shell">
      <title>Restricted Shell Commands</title>

      <sect3 id="cvs">
	<title>cvs server</title>
	<para>This allows you to use CVS (CVS in
	  client/server mode invokes <code>cvs server</code> on the
	  remote side to do its processing).</para>
      </sect3>

      <sect3 id="passwd">
	<title>passwd</title>

	<para>This allows you to change your password
	  interactively. Remember that you have to use <code>ssh -t</code>
          so that your password does not get echoed on the screen.
          This feature currently serves no purpose.
        </para>
      </sect3>

      <sect3 id="pwstore">
	<title>pwstore</title>

	<para>This allows you to set your initial Kerberos password.
	  Remember that you have to use <code>ssh -t</code>
          so that your password does not get echoed on the screen.</para>
      </sect3>

      <sect3 id="keys">
	<title>update_my_keys</title>

	<para>This command allows you to manage your
	  <filename>.ssh/authorized_keys</filename> file using RCS.
	  You can feed it a new <filename>authorized_keys</filename>
	  on stdin, and it will store the old file using RCS, and then
	  install the new set of keys. It should be invoked as
	  <code><quote>ssh cvs.NetBSD.org
	  update_my_keys</quote></code>, with the new
	  <filename>authorized_keys</filename> file passed to it on
	  stdin. It will not accept null input (deletion of all keys)
	  unless it is invoked as <code>update_my_keys -d</code>.</para>

	<para>Because there is a limit of line length on UNIX tty
	  driver with line-editing enabled, it is safe to do
	  <code><quote>stty -icanon</quote></code> to disable
	  line-editing before invoking <code>update_my_keys</code>.

	  Don't forget to re-enable line-editing by doing
	  <code><quote>stty icanon</quote></code>
	  in such a case.</para>

	<para>
	  If you make an error, you can ask <ulink
	    url="mailto:admin@NetBSD.org">the admin group</ulink> to
	    restore an older <filename>authorized_keys</filename> file
	    for you. But because a restoration request needs to be
	    signed by PGP, you must <ulink
	    url="pgp.html#distribution-recommendations">commit your
	    PGP key to the repository</ulink> before doing
	    <code>update_my_keys</code>.</para>
      </sect3>

      <sect3 id="rsync">
	<title>rsync --server --daemon</title>

	<para>This command requires rsync 2.5.6 or newer. It allows
	  you to run rsync in daemon mode over an SSH connection. Your
	  login shell will adjust any rsync command line to force the
	  use of an rsync daemon configuration file that will only
	  allow you to read <filename>/cvsroot</filename>,
	  using module name <code>cvsroot</code>.
	  So, you invoke rsync like this (for example):
	  <programlisting>rsync -avS -e ssh &lt;login&gt;@cvs.NetBSD.org::cvsroot/src .</programlisting>
	  Please note the presence of both <code>-e ssh</code> and
	  <code>::</code>, which are not supported by rsync before
	  2.5.6. This command will connect to cvs.NetBSD.org using ssh
	  as user <code>loginname</code>, invoke the rsync daemon, and
	  fetch the <filename>src</filename> subdirectory of the
	  <filename>cvsroot</filename> module, which of course
	  corresponds to <filename>/cvsroot/src</filename>.
        </para><para>If you want to rsync the entire repository, take care
          not to sync CVSROOT/history.*.gz and CVSROOT/commitlog.*.gz
          unless you want to engage in historical studies. Both are
          currently rotated using newsyslogd, ie they change names every
          other day, and their sum is ~2GB.
        </para>
      </sect3>

    </sect2>
  </sect1>

  <parentsec url="." text="NetBSD Developer Documentation"/>
</webpage>

