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.
 
 
 
 
 
 

143 lines
6.1 KiB

  1. <?xml version="1.0" encoding="utf-8" standalone="no"?>
  2. <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  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. &apt-author.team;
  11. &apt-email;
  12. &apt-product;
  13. <!-- The last update date -->
  14. <date>2019-12-02T00: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>[protocol://]</replaceable><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>
  56. <para>If protocol is not specified, the entry only matches https and tor+https.</para></listitem>
  57. </varlistentry>
  58. <varlistentry>
  59. <term><literal>login</literal> <replaceable>name</replaceable></term>
  60. <listitem><para>The username to be used.</para></listitem>
  61. </varlistentry>
  62. <varlistentry>
  63. <term><literal>password</literal> <replaceable>string</replaceable></term>
  64. <listitem><para>The password to be used.</para></listitem>
  65. </varlistentry>
  66. </variablelist>
  67. </refsect1>
  68. <refsect1><title>Example</title>
  69. <para>Supplying login information for a user named <literal>apt</literal>
  70. with the password <literal>debian</literal> for the &sources-list; entry
  71. <literallayout>deb https://example.org/debian &debian-stable-codename; main</literallayout>
  72. could be done in the entry directly:
  73. <literallayout>deb https://apt:debian@example.org/debian &debian-stable-codename; main</literallayout>
  74. Alternatively an entry like the following in the auth.conf file could be used:
  75. <literallayout>machine example.org
  76. login apt
  77. password debian</literallayout>
  78. Or alternatively within a single line:
  79. <literallayout>machine example.org login apt password debian</literallayout>
  80. If you need to be more specific all of these lines will also apply to the example entry:
  81. <literallayout>machine example.org/deb login apt password debian
  82. machine example.org/debian login apt password debian
  83. machine example.org/debian/ login apt password debian
  84. </literallayout>
  85. On the other hand neither of the following lines apply:
  86. <literallayout>machine example.org:443 login apt password debian
  87. machine example.org/deb/ login apt password debian
  88. machine example.org/ubuntu login apt password debian
  89. machine example.orga login apt password debian
  90. machine example.net login apt password debian
  91. </literallayout>
  92. </para>
  93. </refsect1>
  94. <refsect1><title>Notes</title>
  95. <para>Basic support for this feature is present since version 0.7.25, but was
  96. undocumented for years. The documentation was added in version 1.5 changing
  97. also the implementation slightly. For maximum backward compatibility you should
  98. avoid multiple <literal>machine</literal> tokens with the same hostname, but if
  99. you need multiple they should all have a path specified in the
  100. <literal>machine</literal> token.</para>
  101. <para>Login information in auth.conf are more flexible than those in sources.list. For
  102. example, login information can be specified for parts of a repository only, or if the
  103. sources.list entry redirects elsewhere, login information for the redirect destination can be supplied.</para>
  104. </refsect1>
  105. <refsect1>
  106. <title>Files</title>
  107. <variablelist>
  108. <varlistentry><term><filename>/etc/apt/auth.conf</filename></term>
  109. <listitem><para>Login information for APT sources and proxies in a netrc-like format.
  110. Configuration Item: <literal>Dir::Etc::netrc</literal>.</para></listitem>
  111. </varlistentry>
  112. <varlistentry><term><filename>/etc/apt/auth.conf.d/*.conf</filename></term>
  113. <listitem><para>Login information for APT sources and proxies in a netrc-like format.
  114. Configuration Item: <literal>Dir::Etc::netrcparts</literal>.</para></listitem>
  115. </varlistentry>
  116. </variablelist>
  117. </refsect1>
  118. <refsect1>
  119. <title>See Also</title>
  120. <para>&apt-conf; &sources-list;
  121. </para>
  122. </refsect1>
  123. &manbugs;
  124. </refentry>