5

I have a couple of local apt repositories which are setup using reprepro.

I want to make them available on the local network and I've got next to everything setup.

However the repos are sitting behind https (this is out of my control) so when I try to pull from them from another server the request just hangs and I think it's because it is waiting for the username / password to be supplied.

I'm not sure how to supply these. Do they go in the sources.list file on the pulling server? What would the format be?

Cheers

marcelm
  • 1,032
  • 11
  • 11
Kash.
  • 242
  • 1
  • 3
  • 15
  • 1
    https by itself does not imply authentication is necessary. It only implies that transmission is encrypted, which occurs by negotiation between the client and server. – zkilnbqi Sep 22 '13 at 08:24
  • Thanks for that. But in this case there is a password required. If I put the direct URL to the Packages file in my browser, it requests a username / password. – Kash. Sep 22 '13 at 10:42

3 Answers3

13

Instead of hardcoding the password in sources.list, its better to create an auth.conf file and supply your credentials as is documented in Debian page:

/etc/apt/auth.conf:

machine example.org
login apt
password debian

for an entry like below in sources.list

deb https://example.org/debian buster main

Refer for more info: Debian Page Reference

Ron Thomas
  • 737
  • 1
  • 8
  • 20
4

In order to supply a password to a debian-style repository with https, add this line to /etc/apt/sources.list

deb https://user:password@repo.server.com/debian ./

zkilnbqi
  • 1,141
  • 11
  • 23
0

If you want per user authentication, you can pass a custom auth.conf per apt call:

    trap "rm ./auth.conf.tmp" EXIT

    cat << EOF > ./auth.conf.tmp
    machine example.org
    login apt
    password debian
    EOF

    # overrule /etc/apt/auth.conf with Dir::Etc::netrc config
    # see all options with
    # zcat /usr/share/doc/apt/examples/configure-index.gz
    sudo apt -o Dir::Etc::netrc=./auth.conf.tmp update

Sources:

elsamuko
  • 668
  • 6
  • 16