]> granicus.if.org Git - shadow/blob - man/chsh.1.xml
* src/faillog.c, src/chage.c, src/newusers.c, src/su.c: The getopt
[shadow] / man / chsh.1.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3    Copyright (c) 1990       , Julianne Frances Haugh
4    Copyright (c) 2007 - 2011, Nicolas François
5    All rights reserved.
6   
7    Redistribution and use in source and binary forms, with or without
8    modification, are permitted provided that the following conditions
9    are met:
10    1. Redistributions of source code must retain the above copyright
11       notice, this list of conditions and the following disclaimer.
12    2. Redistributions in binary form must reproduce the above copyright
13       notice, this list of conditions and the following disclaimer in the
14       documentation and/or other materials provided with the distribution.
15    3. The name of the copyright holders or contributors may not be used to
16       endorse or promote products derived from this software without
17       specific prior written permission.
18   
19    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22    PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
23    HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 -->
31 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
32   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
33 <!ENTITY CHSH_AUTH             SYSTEM "login.defs.d/CHSH_AUTH.xml">
34 <!ENTITY LOGIN_STRING          SYSTEM "login.defs.d/LOGIN_STRING.xml">
35 <!-- SHADOW-CONFIG-HERE -->
36 ]>
37
38 <refentry id='chsh.1'>
39   <!-- $Id$ -->
40   <refmeta>
41     <refentrytitle>chsh</refentrytitle>
42     <manvolnum>1</manvolnum>
43     <refmiscinfo class="sectdesc">User Commands</refmiscinfo>
44     <refmiscinfo class="source">shadow-utils</refmiscinfo>
45     <refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo>
46   </refmeta>
47   <refnamediv id='name'>
48     <refname>chsh</refname>
49     <refpurpose>change login shell</refpurpose>
50   </refnamediv>
51
52   <refsynopsisdiv id='synopsis'>
53     <cmdsynopsis>
54       <command>chsh</command>
55       <arg choice='opt'>
56         <replaceable>options</replaceable>
57       </arg>
58       <arg choice='opt'>
59         <replaceable>LOGIN</replaceable>
60       </arg>
61     </cmdsynopsis>
62   </refsynopsisdiv>
63
64   <refsect1 id='description'>
65     <title>DESCRIPTION</title>
66     <para>
67       The <command>chsh</command> command changes the user login shell.
68       This determines the name of the user's initial login command. A normal
69       user may only change the login shell for her own account; the
70       superuser may change the login shell for any account.
71     </para>
72
73   </refsect1>
74
75   <refsect1 id='options'>
76     <title>OPTIONS</title>
77     <para>
78       The options which apply to the <command>chsh</command> command are:
79     </para>
80     <variablelist remap='IP'>
81       <varlistentry>
82         <term><option>-h</option>, <option>--help</option></term>
83         <listitem>
84           <para>Display help message and exit.</para>
85         </listitem>
86       </varlistentry>
87       <varlistentry>
88         <term>
89           <option>-R</option>, <option>--root</option>
90           <replaceable>CHROOT_DIR</replaceable>
91         </term>
92         <listitem>
93           <para>
94             Apply changes in the <replaceable>CHROOT_DIR</replaceable>
95             directory and use the configuration files from the
96             <replaceable>CHROOT_DIR</replaceable> directory.
97           </para>
98         </listitem>
99       </varlistentry>
100       <varlistentry>
101         <term>
102           <option>-s</option>, <option>--shell</option> <replaceable>SHELL</replaceable>
103         </term>
104         <listitem>                                                                                                                   
105           <para>
106             The name of the user's new login shell. Setting this field to
107             blank causes the system to select the default login shell.
108           </para>
109         </listitem>
110       </varlistentry>
111     </variablelist>
112     <para>
113       If the <option>-s</option> option is not selected,
114       <command>chsh</command> operates in an interactive fashion, prompting
115       the user with the current login shell. Enter the new value to change
116       the shell, or leave the line blank to use the current one. The current
117       shell is displayed between a pair of <emphasis>[ ]</emphasis> marks.
118     </para>
119   </refsect1>
120
121   <refsect1 id='note'>
122     <title>NOTE</title>
123     <para>
124       The only restriction placed on the login shell is that the command
125       name must be listed in <filename>/etc/shells</filename>, unless the
126       invoker is the superuser, and then any value may be added. An
127       account with a restricted login shell may not change her login shell.
128       For this reason, placing <filename>/bin/rsh</filename> in
129       <filename>/etc/shells</filename> is discouraged since accidentally
130       changing to a restricted shell would prevent the user from ever
131       changing her login shell back to its original value.
132     </para>
133   </refsect1>
134
135   <refsect1 id='configuration' condition="no_pam">
136     <title>CONFIGURATION</title>
137     <para>
138       The following configuration variables in
139       <filename>/etc/login.defs</filename> change the behavior of this
140       tool:
141     </para>
142     <variablelist>
143       &CHSH_AUTH;
144       &LOGIN_STRING;
145     </variablelist>
146   </refsect1>
147
148   <refsect1 id='files'>
149     <title>FILES</title>
150     <variablelist>
151       <varlistentry>
152         <term><filename>/etc/passwd</filename></term>
153         <listitem>
154           <para>User account information.</para>
155         </listitem>
156       </varlistentry>
157       <varlistentry>
158         <term><filename>/etc/shells</filename></term>
159         <listitem>
160           <para>List of valid login shells.</para>
161         </listitem>
162       </varlistentry>
163       <varlistentry>
164         <term><filename>/etc/login.defs</filename></term>
165         <listitem>
166           <para>Shadow password suite configuration.</para>
167         </listitem>
168       </varlistentry>
169     </variablelist>
170   </refsect1>
171
172   <refsect1 id='see_also'>
173     <title>SEE ALSO</title>
174     <para>
175       <citerefentry>
176         <refentrytitle>chfn</refentrytitle><manvolnum>1</manvolnum>
177       </citerefentry>,
178       <citerefentry>
179         <refentrytitle>login.defs</refentrytitle><manvolnum>5</manvolnum>
180       </citerefentry>,
181       <citerefentry>
182         <refentrytitle>passwd</refentrytitle><manvolnum>5</manvolnum>
183       </citerefentry>.
184     </para>
185   </refsect1>
186 </refentry>