문제

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

도움이 되었습니까?

해결책 2

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 ./

다른 팁

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

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:

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top