Posted: October 17, 2007. Tags: Linux, CentOS
To create a password protected YUM repository:
Setup http authentication inĀ httpd.conf file (encouraged rather than using .htaccess):
<Directory /var/www/repo> AuthType Basic AuthName "Password Required" AuthUserFile /etc/apache2/passwords/repo Require valid-user <Directory>
Create auth user password file:
htpasswd -c /etc/apache2/passwords/repo repouser
Restart apache.
Create repo:
yum install createrepo # or equivalent mkdir /var/www/repo cp *.rpm /var/www/repo createrepo /var/www/repo
To use the repo, on the client system in /etc/yum.repo.d/<reponame>.repo, have:
baseurl=http://repouser:[email protected]/repo