I have set my own private yum repo. This is an HTTP base repo with a Apache as a web server, so I would like to add some kind of authentication. Is this something I need to do with Apache or is there anything I can do with the createrepo library to specify a user-name and password? The final goal is to have several repos:
Dev-Repo, QA-Repo, Staging-Repo, and Production-Repo
I want developers to have access to only the dev-repo, have QA access only QA-Repo and so on...
To enable all repositories run "yum-config-manager --enable \*". --disable Disable the specified repos (automatically saves). To disable all repositories run "yum-config-manager --disable \*". --add-repo=ADDREPO Add (and enable) the repo from the specified file or url.
createrepo is a program that creates a repomd (xml-based rpm metadata) repository from a set of rpms.
To disable a particular repository or repositories, run the following command as the root user: yum-config-manager --disable repository… Alternatively, you can use a global regular expression to disable all matching Yum repositories: yum-config-manager --disable glob_expression…
To setup basic auth on server side, follow http://httpd.apache.org/docs/2.2/howto/auth.html#gettingitworking (paths might differ - they surely do on mine Fedora installation).
To setup yum to consume that repo you can add either:
baseurl=http://user:[email protected]/myrepo/Dev-Repo
or:
username=user
password=pass
to repo's config /etc/yum.repos.d/myrepo-DevRepo.repo
(taken from https://serverfault.com/questions/609548/yum-repo-basic-auth-not-working).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With