You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

139 lines
5.7 KiB

  1. <?xml version="1.0" encoding="utf-8" standalone="no"?>
  2. <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "" [
  4. <!ENTITY % aptent SYSTEM "apt.ent"> %aptent;
  5. <!ENTITY % aptverbatiment SYSTEM "apt-verbatim.ent"> %aptverbatiment;
  6. <!ENTITY % aptvendor SYSTEM "apt-vendor.ent"> %aptvendor;
  7. ]>
  8. <refentry>
  9. <refentryinfo>
  10. &;
  11. &apt-email;
  12. &apt-product;
  13. <!-- The last update date -->
  14. <date>2018-12-03T00:00:00Z</date>
  15. </refentryinfo>
  16. <refmeta>
  17. <refentrytitle>apt_auth.conf</refentrytitle>
  18. <manvolnum>5</manvolnum>
  19. <refmiscinfo class="manual">APT</refmiscinfo>
  20. </refmeta>
  21. <!-- Man page title -->
  22. <refnamediv>
  23. <refname>apt_auth.conf</refname>
  24. <refpurpose>Login configuration file for APT sources and proxies</refpurpose>
  25. </refnamediv>
  26. <refsect1><title>Description</title>
  27. <para>APT configuration files like &sources-list; or &apt-conf; need to be accessible
  28. for everyone using apt tools on the system to have access to all package-related
  29. information like the available packages in a repository. Login information
  30. needed to connect to a proxy or to download data from a repository on the other
  31. hand shouldn't always be accessible by everyone and can hence not be placed in a
  32. file with world-readable file permissions.</para>
  33. <para>The APT auth.conf file <filename>/etc/apt/auth.conf</filename>, and .conf files inside
  34. <filename>/etc/apt/auth.conf.d</filename> can be used to store
  35. login information in a netrc-like format with restrictive file permissions.</para>
  36. </refsect1>
  37. <refsect1><title>netrc-like format</title>
  38. <para>The format defined here is similar to the format of the <filename>~/.netrc</filename>
  39. file used by <citerefentry><refentrytitle><command>ftp</command></refentrytitle><manvolnum>1</manvolnum></citerefentry>
  40. and similar programs interacting with servers.
  41. It is a simple token-based format with the following tokens being recognized;
  42. Unknown tokens will be ignored. Tokens may be separated by spaces, tabs or newlines.</para>
  43. <variablelist>
  44. <varlistentry>
  45. <term><literal>machine</literal> <replaceable>hostname</replaceable>[:<replaceable>port</replaceable>][/<replaceable>path</replaceable>]</term>
  46. <listitem><para>Entries are looked up by searching for the
  47. <emphasis><literal>machine</literal></emphasis> token matching the
  48. hostname of the URI apt needs login information for. Extending the netrc-format
  49. a portnumber can be specified. If no port is given the token matches for all ports.
  50. Similar the path is optional and only needed and useful if multiple repositories with
  51. different login information reside on the same server. A machine token with a path
  52. matches if the path in the URI starts with the path given in the token.
  53. Once a match is made, the subsequent tokens are processed, stopping when the
  54. end of file is reached or another <emphasis><literal>machine</literal></emphasis>
  55. token is encountered.</para></listitem>
  56. </varlistentry>
  57. <varlistentry>
  58. <term><literal>login</literal> <replaceable>name</replaceable></term>
  59. <listitem><para>The username to be used.</para></listitem>
  60. </varlistentry>
  61. <varlistentry>
  62. <term><literal>password</literal> <replaceable>string</replaceable></term>
  63. <listitem><para>The password to be used.</para></listitem>
  64. </varlistentry>
  65. </variablelist>
  66. </refsect1>
  67. <refsect1><title>Example</title>
  68. <para>Supplying login information for a user named <literal>apt</literal>
  69. with the password <literal>debian</literal> for the &sources-list; entry
  70. <literallayout>deb &debian-stable-codename; main</literallayout>
  71. could be done in the entry directly:
  72. <literallayout>deb &debian-stable-codename; main</literallayout>
  73. Alternatively an entry like the following in the auth.conf file could be used:
  74. <literallayout>machine
  75. login apt
  76. password debian</literallayout>
  77. Or alternatively within a single line:
  78. <literallayout>machine login apt password debian</literallayout>
  79. If you need to be more specific all of these lines will also apply to the example entry:
  80. <literallayout>machine login apt password debian
  81. machine login apt password debian
  82. machine login apt password debian
  83. </literallayout>
  84. On the other hand neither of the following lines apply:
  85. <literallayout>machine login apt password debian
  86. machine login apt password debian
  87. machine login apt password debian
  88. machine example.orga login apt password debian
  89. machine login apt password debian
  90. </literallayout>
  91. </para>
  92. </refsect1>
  93. <refsect1><title>Notes</title>
  94. <para>Basic support for this feature is present since version 0.7.25, but was
  95. undocumented for years. The documentation was added in version 1.5 changing
  96. also the implementation slightly. For maximum backward compatibility you should
  97. avoid multiple <literal>machine</literal> tokens with the same hostname, but if
  98. you need multiple they should all have a path specified in the
  99. <literal>machine</literal> token.</para>
  100. </refsect1>
  101. <refsect1>
  102. <title>Files</title>
  103. <variablelist>
  104. <varlistentry><term><filename>/etc/apt/auth.conf</filename></term>
  105. <listitem><para>Login information for APT sources and proxies in a netrc-like format.
  106. Configuration Item: <literal>Dir::Etc::netrc</literal>.</para></listitem>
  107. </varlistentry>
  108. <varlistentry><term><filename>/etc/apt/auth.conf.d/*.conf</filename></term>
  109. <listitem><para>Login information for APT sources and proxies in a netrc-like format.
  110. Configuration Item: <literal>Dir::Etc::netrcparts</literal>.</para></listitem>
  111. </varlistentry>
  112. </variablelist>
  113. </refsect1>
  114. <refsect1>
  115. <title>See Also</title>
  116. <para>&apt-conf; &sources-list;
  117. </para>
  118. </refsect1>
  119. &manbugs;
  120. </refentry>