Sample Header Ad - 728x90

Is it possible to pass Basic Auth credentials to apt-get as command line arguments?

0 votes
0 answers
300 views
I use Alt Linux 10.2. The only way to store Basic Auth credentials supported here is to write them directly to the sources.list file:
rpm [p10] http://login:password@somerepo.com  x86_64 classic
In the project I work to, the credentials are stored in some utility (suppose it's called credmaster). I need to hide my credentials as far as possible so just write them to sources.list is not possible. One of idea is to replace apt-get with a wrapper script that would obtain credentials before calling apt-get and pass them to it. Something like that:
LOGIN=$(credmaster --login)
PSWD=$(credmaster --password)
apt-get -o 'BasicAuthCred=somerepo.url:$LOGIN:$PSWD' update
...
I tried the approach with Dir::Etc::netrc option but it did not work out (I guess apt version is too old). Is there another way or workaround to pass Basic Auth credentials to apt-get without need to store them in file?
Asked by nst1911 (93 rep)
Oct 21, 2024, 05:00 PM
Last activity: Oct 21, 2024, 05:37 PM