Set up private yum repo with basic auth

て烟熏妆下的殇ゞ 提交于 2020-02-18 22:20:09

问题


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


回答1:


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:pass@example.com/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).



来源:https://stackoverflow.com/questions/15685560/set-up-private-yum-repo-with-basic-auth

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!