3

In /etc/apt/auth.conf, I have the lines

machine example.org/nexus/repository/my_apt_repo/
login my_usename
password not my actual password 1!

Attempting to run sudo apt update results in the error message

E: Failed to fetch https://example.org/nexus/repository/my_apt_repo/dists/bionic/main/binary-amd64/Packages  401  Unauthorized 

This seems to try and fail to log in often enough to freeze my credentials temporarily.

This has been set up by an ansible playbook that works for other people, and I can log in to nexus with the given credentials and fetch a package.

I presume this is a matter of needing to escape the password somehow. Is this correct, and if yes, how do I escape spaces, exclamation points etc. in my password?

There is a question about configuring http proxy login, but the accepted answer does not solve this issue because this is a different configuration.

Haem
  • 131
  • 6

1 Answers1

1

2 methods:

  • use html encoding

    1 \&<>"' becomes 1%5C%20%26%3C%3E%22%27

  • use a \

    1 \&<>"' becomes 1\\\ \&\<\>\"\'

Easier fix: change the password to one that excludes special characters. I tend to use a random password generator and exlude special symbols and ambiguous characters.

Rinzwind
  • 293,910
  • 41
  • 570
  • 710