You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
484 lines
12 KiB
Plaintext
484 lines
12 KiB
Plaintext
13 years ago
|
<?xml version="1.0" ?>
|
||
|
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN"
|
||
|
"dtd/kdex.dtd" [
|
||
13 years ago
|
<!ENTITY kappname "&tdesu;">
|
||
|
<!ENTITY package "tdebase">
|
||
13 years ago
|
<!ENTITY % addindex "IGNORE">
|
||
|
<!ENTITY % British-English "INCLUDE"
|
||
|
> <!-- change language only here -->
|
||
|
]>
|
||
|
|
||
|
<book lang="&language;">
|
||
|
<bookinfo>
|
||
|
|
||
|
<title
|
||
13 years ago
|
>The &tdesu; handbook</title>
|
||
13 years ago
|
|
||
|
<authorgroup>
|
||
|
<author
|
||
|
>&Geert.Jansen; &Geert.Jansen.mail;</author>
|
||
|
<othercredit role="translator"
|
||
|
><firstname
|
||
|
>John</firstname
|
||
|
><surname
|
||
|
>Knight</surname
|
||
|
><affiliation
|
||
|
><address
|
||
|
><email
|
||
|
>anarchist_tomato@herzeleid.net</email
|
||
|
></address
|
||
|
></affiliation
|
||
|
><contrib
|
||
|
>Conversion to British English</contrib
|
||
|
></othercredit
|
||
|
>
|
||
|
</authorgroup>
|
||
|
|
||
|
<copyright>
|
||
|
<year
|
||
|
>2000</year>
|
||
|
<holder
|
||
|
>&Geert.Jansen;</holder>
|
||
|
</copyright>
|
||
|
|
||
|
<legalnotice
|
||
|
>&FDLNotice;</legalnotice>
|
||
|
|
||
|
<date
|
||
|
>2002-01-18</date>
|
||
|
<releaseinfo
|
||
|
>1.00.00</releaseinfo>
|
||
|
|
||
|
|
||
|
<abstract
|
||
|
><para
|
||
13 years ago
|
>&tdesu; is a graphical front end for the &UNIX; <command
|
||
13 years ago
|
>su</command
|
||
|
> command.</para
|
||
|
></abstract>
|
||
|
|
||
|
<keywordset>
|
||
|
<keyword
|
||
|
>KDE</keyword>
|
||
|
<keyword
|
||
|
>su</keyword>
|
||
|
<keyword
|
||
|
>password</keyword>
|
||
|
<keyword
|
||
|
>root</keyword>
|
||
|
</keywordset>
|
||
|
|
||
|
</bookinfo>
|
||
|
|
||
|
<chapter id="introduction">
|
||
|
<title
|
||
|
>Introduction</title>
|
||
|
|
||
|
<para
|
||
13 years ago
|
>Welcome to &tdesu;! &tdesu; is a graphical front end for the &UNIX; <command
|
||
13 years ago
|
>su</command
|
||
13 years ago
|
> command for the K Desktop Environment. It allows you to run a program as different user by supplying the password for that user. &tdesu; is an unprivileged program; it uses the system's <command
|
||
13 years ago
|
>su</command
|
||
|
>.</para>
|
||
|
|
||
|
<para
|
||
13 years ago
|
>&tdesu; has one additional feature: it can remember passwords for you. If you are using this feature, you only need to enter the password once for each command. See <xref linkend="sec-password-keeping"/> for more information on this and a security analysis.</para>
|
||
13 years ago
|
|
||
|
<para
|
||
|
>This program is meant to be started from the command line or from <filename
|
||
|
>.desktop</filename
|
||
|
> files. Although it asks for the <systemitem class="username"
|
||
|
>root</systemitem
|
||
|
> password using a &GUI; dialogue, I consider it to be more of a command line <-> &GUI; glue instead of a pure &GUI; program.</para>
|
||
|
|
||
|
</chapter>
|
||
|
|
||
13 years ago
|
<chapter id="using-tdesu">
|
||
13 years ago
|
<title
|
||
13 years ago
|
>Using &tdesu;</title>
|
||
13 years ago
|
|
||
|
<para
|
||
13 years ago
|
>Usage of &tdesu; is easy. The syntax is like this:</para>
|
||
13 years ago
|
|
||
|
<cmdsynopsis
|
||
|
><command
|
||
13 years ago
|
>tdesu</command
|
||
13 years ago
|
> <arg
|
||
|
>USER</arg
|
||
|
> <arg
|
||
|
>-n</arg
|
||
|
> <arg
|
||
|
>-t</arg
|
||
|
> <arg
|
||
|
>-q</arg
|
||
|
> <arg
|
||
|
>-d</arg
|
||
|
> <arg
|
||
|
>-f <replaceable
|
||
|
>FILE</replaceable
|
||
|
></arg
|
||
|
> <arg
|
||
|
>-c <group
|
||
|
> <arg
|
||
|
> <replaceable
|
||
|
>COMMAND</replaceable
|
||
|
> <arg
|
||
|
><replaceable
|
||
|
>ARG1</replaceable
|
||
|
></arg
|
||
|
> <arg
|
||
|
><replaceable
|
||
|
>ARG2</replaceable
|
||
|
></arg
|
||
|
> <arg rep="repeat"
|
||
|
><replaceable
|
||
|
></replaceable
|
||
|
></arg
|
||
|
> </arg
|
||
|
> </group
|
||
|
> </arg
|
||
|
> </cmdsynopsis>
|
||
|
|
||
|
<cmdsynopsis
|
||
|
><command
|
||
13 years ago
|
>tdesu</command
|
||
13 years ago
|
> <group
|
||
|
> <arg
|
||
|
>-v</arg
|
||
|
> <arg
|
||
|
>-h</arg
|
||
|
> <arg
|
||
|
>-s</arg
|
||
|
> </group
|
||
|
> </cmdsynopsis>
|
||
|
|
||
|
<para
|
||
|
>The command line options are explained below.</para>
|
||
|
|
||
|
<variablelist>
|
||
|
<varlistentry>
|
||
|
<term
|
||
|
><option
|
||
|
>-c <replaceable
|
||
|
>PROGRAM</replaceable
|
||
|
></option
|
||
|
></term>
|
||
|
<listitem
|
||
|
><para
|
||
|
>This specifies the program to run as root. It has to be passed in one argument. So if, for example, you want to start a new file manager, you would enter at the prompt: <userinput
|
||
|
><command
|
||
13 years ago
|
>tdesu <option
|
||
13 years ago
|
>-c <replaceable
|
||
|
>kfm -sw</replaceable
|
||
|
></option
|
||
|
></command
|
||
|
></userinput
|
||
|
></para
|
||
|
></listitem>
|
||
|
</varlistentry>
|
||
|
<varlistentry>
|
||
|
<term
|
||
|
><option
|
||
|
>-f <replaceable
|
||
|
>FILE</replaceable
|
||
|
></option
|
||
|
></term>
|
||
|
<listitem
|
||
|
><para
|
||
13 years ago
|
>This option allow efficient use of &tdesu; in <filename
|
||
13 years ago
|
>.desktop</filename
|
||
13 years ago
|
> files. It tells &tdesu; to examine the file specified by <parameter
|
||
13 years ago
|
>FILE</parameter
|
||
13 years ago
|
>. If this file is writable by the current user, &tdesu; will execute the command as the current user. If it is not writable, the command is executed as user <parameter
|
||
13 years ago
|
>USER</parameter
|
||
|
> (defaults to root).</para>
|
||
|
<para
|
||
|
><parameter
|
||
|
>FILE</parameter
|
||
|
> is evaluated like this: if <parameter
|
||
|
>FILE</parameter
|
||
|
> starts with a <literal
|
||
|
>/</literal
|
||
|
>, it is taken as an absolute filename. Otherwise, it is taken as the name of a global &kde; configuration file. For example: to configure the K display manager, <application
|
||
|
>kdm</application
|
||
|
>, you could issue <command
|
||
13 years ago
|
>tdesu <option
|
||
13 years ago
|
>-c kdmconfig -f kdmrc</option
|
||
|
></command
|
||
|
></para
|
||
|
></listitem>
|
||
|
</varlistentry>
|
||
|
<varlistentry>
|
||
|
<term
|
||
|
><option
|
||
|
>-t</option
|
||
|
></term>
|
||
|
<listitem
|
||
|
><para
|
||
|
>Enable terminal output. This disables password keeping. This is largely for debugging purposes; if you want to run a console mode app, use the standard <command
|
||
|
>su</command
|
||
|
> instead.</para
|
||
|
> </listitem>
|
||
|
</varlistentry>
|
||
|
<varlistentry>
|
||
|
<term
|
||
|
><option
|
||
|
>-n</option
|
||
|
></term>
|
||
|
<listitem
|
||
|
><para
|
||
|
>Do not keep the password. This disables the <guilabel
|
||
|
>keep password</guilabel
|
||
|
> checkbox in the password dialogue.</para
|
||
|
></listitem>
|
||
|
</varlistentry>
|
||
|
<varlistentry>
|
||
|
<term
|
||
|
><option
|
||
|
>-q</option
|
||
|
></term>
|
||
|
<listitem
|
||
|
><para
|
||
|
>Be quiet.</para
|
||
|
></listitem>
|
||
|
<!-- Lauri: This could do with a little expansion. quiet as in no screen -->
|
||
|
<!-- output, quiet as in no gui prompt for the password, or quiet as in no -->
|
||
|
<!-- beeping? -->
|
||
|
</varlistentry>
|
||
|
|
||
|
<varlistentry>
|
||
|
<term
|
||
|
><option
|
||
|
>-d</option
|
||
|
></term>
|
||
|
<listitem
|
||
|
><para
|
||
|
>Show debug information.</para
|
||
|
></listitem>
|
||
|
</varlistentry>
|
||
|
<varlistentry>
|
||
|
<term
|
||
|
><option
|
||
|
>-v</option
|
||
|
></term>
|
||
|
<listitem
|
||
|
><para
|
||
|
>Print version information and exit.</para
|
||
|
></listitem>
|
||
|
</varlistentry>
|
||
|
<varlistentry>
|
||
|
<term
|
||
|
><option
|
||
|
>-h</option
|
||
|
></term>
|
||
|
<listitem
|
||
|
><para
|
||
|
>Print some help.</para
|
||
|
></listitem>
|
||
|
</varlistentry>
|
||
|
<varlistentry>
|
||
|
<term
|
||
|
><option
|
||
|
>-s</option
|
||
|
></term>
|
||
|
<listitem
|
||
|
><para
|
||
13 years ago
|
>Stop the tdesu daemon. See <xref linkend="sec-password-keeping"/>.</para
|
||
13 years ago
|
></listitem>
|
||
|
</varlistentry>
|
||
|
</variablelist>
|
||
|
|
||
|
</chapter>
|
||
|
|
||
|
<chapter id="configuration">
|
||
|
<title
|
||
|
>Configuration</title>
|
||
|
|
||
|
<para
|
||
13 years ago
|
>&tdesu; comes with a control module named <application
|
||
|
>kcmtdesu</application
|
||
13 years ago
|
>. You can find it in the <guimenu
|
||
|
>K</guimenu
|
||
|
> menu under <menuchoice
|
||
|
><guisubmenu
|
||
|
>Settings</guisubmenu
|
||
|
> <guisubmenu
|
||
|
>Applications</guisubmenu
|
||
|
> <guimenuitem
|
||
|
>KDE su</guimenuitem
|
||
|
></menuchoice
|
||
|
>. You can change the following things:</para>
|
||
|
|
||
|
<variablelist>
|
||
|
<varlistentry>
|
||
|
<term
|
||
|
><guilabel
|
||
|
>Echo Mode</guilabel
|
||
|
></term>
|
||
|
<listitem
|
||
|
><para
|
||
|
>This is how characters you type are echoed to the screen. Possible choices are: one star per character, three stars or no echo at all. The default is one star per character.</para
|
||
|
></listitem>
|
||
|
</varlistentry>
|
||
|
<varlistentry>
|
||
|
<term
|
||
|
><guilabel
|
||
|
>Keeping passwords</guilabel
|
||
|
></term>
|
||
|
<listitem
|
||
|
><para
|
||
13 years ago
|
>You can instruct &tdesu; remember passwords you enter by checking the <guilabel
|
||
13 years ago
|
>keep password</guilabel
|
||
|
> check box. If this checked, you can enter a timeout value in the text field below it. This is the amount of time, in minutes, that the password will be remembered. The default is not to remember passwords.</para
|
||
|
></listitem>
|
||
|
</varlistentry>
|
||
|
</variablelist>
|
||
|
|
||
|
</chapter>
|
||
|
|
||
|
<chapter id="Internals">
|
||
|
<title
|
||
|
>Internals</title>
|
||
|
|
||
|
<sect1 id="x-authentication">
|
||
|
<title
|
||
|
>X authentication</title>
|
||
|
|
||
|
<para
|
||
13 years ago
|
>The program you execute will run under the root user id and will generally have no authority to access your X display. &tdesu; gets around this by adding an authentication cookie for your display to a temporary <filename
|
||
13 years ago
|
>.Xauthority</filename
|
||
|
> file. After the command exits, this file is removed. </para>
|
||
|
|
||
|
<para
|
||
13 years ago
|
>If you don't use X cookies, you are on your own. &tdesu; will detect this and will not add a cookie but you will have to make sure that root is allowed to access to your display.</para>
|
||
13 years ago
|
|
||
|
</sect1>
|
||
|
|
||
|
<sect1 id="interface-to-su">
|
||
|
<title
|
||
|
>Interface to <command
|
||
|
>su</command
|
||
|
></title>
|
||
|
|
||
|
<para
|
||
13 years ago
|
>&tdesu; uses the sytem's <command
|
||
13 years ago
|
>su</command
|
||
13 years ago
|
> for acquiring priviliges. In this section, I explain the details of how &tdesu; does this. </para>
|
||
13 years ago
|
|
||
|
<para
|
||
|
>Because some <command
|
||
|
>su</command
|
||
|
> implementations (&ie; the one from &RedHat;) don't want to read the password from <literal
|
||
|
>stdin</literal
|
||
13 years ago
|
>, &tdesu; creates a pty/tty pair and executes <command
|
||
13 years ago
|
>su</command
|
||
|
> with it's standard filedescriptors connected to the tty.</para>
|
||
|
|
||
|
<para
|
||
13 years ago
|
>To execute the command the user selected, rather than an interactive shell, &tdesu; uses the <option
|
||
13 years ago
|
>-c</option
|
||
|
> argument with <command
|
||
|
>su</command
|
||
|
>. This argument is understood by every shell that I know of so it should work portably. <command
|
||
|
>su</command
|
||
|
> passes this <option
|
||
|
>-c</option
|
||
|
> argument to the target user's shell, and the shell executes the program. Example command: <command
|
||
|
>su <option
|
||
|
>root -c <replaceable
|
||
|
>the_program</replaceable
|
||
|
></option
|
||
|
></command
|
||
|
>.</para>
|
||
|
|
||
|
<para
|
||
|
>Instead of executing the user command directly with <command
|
||
|
>su</command
|
||
13 years ago
|
>, &tdesu; executes a little stub program called <application
|
||
|
>tdesu_stub</application
|
||
|
>. This stub (running as the target user), requests some information from &tdesu; over the pty/tty channel (the stub's stdin and stdout) and then executes the user's program. The information passed over is: the X display, an X authentication cookie (if available), the <envar
|
||
13 years ago
|
>PATH</envar
|
||
|
> and the command to run. The reason why a stub program is used is that the X cookie is private information and therefore cannot be passed on the command line.</para>
|
||
|
|
||
|
</sect1>
|
||
|
|
||
|
<sect1 id="password-checking">
|
||
|
<title
|
||
|
>Password Checking</title>
|
||
|
|
||
|
<para
|
||
13 years ago
|
>&tdesu; will check the password you entered and gives an error message if it is not correct. The checking is done by executing a test program: <filename
|
||
13 years ago
|
>/bin/true</filename
|
||
|
>. If this succeeds, the password is assumed to be correct.</para>
|
||
|
|
||
|
</sect1>
|
||
|
|
||
|
<sect1 id="sec-password-keeping">
|
||
|
<title
|
||
|
>Password Keeping</title>
|
||
|
|
||
|
<para
|
||
13 years ago
|
>For your comfort, &tdesu; implements a <quote
|
||
13 years ago
|
>keep password</quote
|
||
|
> feature. If you are interested in security, you should read this paragraph.</para>
|
||
|
|
||
|
<para
|
||
13 years ago
|
>Allowing &tdesu; to remember passwords opens up a (small) security hole in your system. Obviously, &tdesu; does not allow anybody but your user id to use the passwords, but, if done without caution, this would lower <systemitem class="username"
|
||
13 years ago
|
>root</systemitem
|
||
|
>'s security level to that of a normal user (you). A hacker who breaks into your account, would get <systemitem class="username"
|
||
|
>root</systemitem
|
||
13 years ago
|
> access. &tdesu; tries to prevent this. The security scheme it uses is, in my opinion at least, reasonably safe and is explained here.</para>
|
||
13 years ago
|
|
||
|
<para
|
||
13 years ago
|
>&tdesu; uses a daemon, called <application
|
||
|
>tdesud</application
|
||
13 years ago
|
>. The daemon listens to a &UNIX; socket in <filename
|
||
|
>/tmp</filename
|
||
13 years ago
|
> for commands. The mode of the socket is 0600 so that only your user id can connect to it. If password keeping is enabled, &tdesu; executes commands through this daemon. It writes the command and <systemitem class="username"
|
||
13 years ago
|
>root</systemitem
|
||
|
>'s password to the socket and the daemon executes the command using <command
|
||
|
>su</command
|
||
|
>, as describe before. After this, the command and the password are not thrown away. Instead, they are kept for a specified amount of time. This is the timeout value from in the control module. If another request for the same command is coming within this time period, the client does not have to supply the password. To keep hackers who broke into your account from stealing passwords from the daemon (for example, by attaching a debugger), the daemon is installed set-group-id nogroup. This should prevent all normal users (including you) from getting passwords from the <application
|
||
13 years ago
|
>tdesud</application
|
||
13 years ago
|
> process. Also, the daemon sets the <envar
|
||
|
>DISPLAY</envar
|
||
|
> environment variable to the value it had when it was started. The only thing a hacker can do is execute an application on your display.</para>
|
||
|
|
||
|
<para
|
||
|
>One weak spot in this scheme is that the programs you execute are probably not written with security in mind (like setuid <systemitem class="username"
|
||
|
>root</systemitem
|
||
|
> programs). This means that they might have buffer overruns or other problems and a hacker could exploit those.</para>
|
||
|
|
||
|
<para
|
||
|
>The use of the password keeping feature is a tradeoff between security and comfort. I encourage you to think it over and decide for yourself if you want to use it or not.</para>
|
||
|
|
||
|
</sect1>
|
||
|
</chapter>
|
||
|
|
||
|
<chapter id="Author">
|
||
|
<title
|
||
|
>Author</title>
|
||
|
|
||
|
<para
|
||
13 years ago
|
>&tdesu;</para>
|
||
13 years ago
|
|
||
|
<para
|
||
|
>Copyright 2000 &Geert.Jansen;</para>
|
||
|
|
||
|
<para
|
||
13 years ago
|
>&tdesu; is written by &Geert.Jansen;. It is somewhat based on Pietro Iglio's &tdesu;, version 0.3. Pietro and I agreed that I will maintain this program in the future.</para>
|
||
13 years ago
|
|
||
|
<para
|
||
|
>The author can be reached through email at &Geert.Jansen.mail;. Please report any bugs you find to me so that I can fix them. If you have a suggestion, feel free to contact me.</para>
|
||
|
&underFDL; &underArtisticLicense; </chapter>
|
||
|
|
||
|
</book>
|
||
|
<!--
|
||
|
Local Variables:
|
||
|
mode: sgml
|
||
|
sgml-omittag: nil
|
||
|
sgml-shorttag: t
|
||
|
End:
|
||
|
-->
|
||
|
|