Kali linux mirror repository

Official Kali Linux Mirrors

The Kali Linux distribution has two repositories, which are mirrored world-wide:

When using the default hosts listed above, you’ll automatically be redirected to a mirror site which is geographically close to you, and which is guaranteed to be up-to-date. If you prefer to manually select a mirror, click on the mirrorlist link near each hostname above and select a mirror that suits you. You will then need to edit your /etc/apt/sources.list file accordingly with the chosen values.

IMPORTANT! Do not add additional repositories to your /etc/apt/sources.list file.Doing so will most likely break your Kali installation.

How to Set Up a Kali Linux Mirror

Requirements

To be an official Kali Linux mirror, you will need a web-accessible server (http required and https if possible too) with lots of disk space, good bandwidth, rsync, and SSH access enabled. As of early 2015, the main package repository is about 450 GB and the ISO images repository is about 50 GB but you can expect those numbers to grow regularly. A mirror site is expected to make the files available over HTTP and RSYNC so those services will need to be enabled. FTP access is optional.

Note on “Push Mirroring” — The Kali Linux mirroring infrastructure uses SSH-based triggers to ping the mirrors when they need to be refreshed. This currently takes place 4 times a day.

Create a User Account for the Mirror

If you don’t have yet an account dedicated for the mirrors, create such an account (here we call it “archvsync”):

$ sudo adduser –disabled-password archvsync
Adding user ‘archvsync’ …
[ … ]
Is the information correct? [ Y / n ]

Create Directories for the Mirror

Create the directories that will contain the mirrors and change their owner to the dedicated user that you just created:

Configure rsync

Next, configure the rsync daemon (enable it if needed) to export those directories:

$ sudo sed -i -e “s/RSYNC_ENABLE=false/RSYNC_ENABLE=true/” / etc / default / rsync
$ sudo vim / etc / rsyncd.conf
$ cat / etc / rsyncd.conf
uid = nobody
gid = nogroup
max connections = 25
socket options = SO_KEEPALIVE

[ kali ]
path = / srv / mirrors / kali
comment = The Kali Archive
read only = true

Читайте также:  Oracle linux network manager

[ kali-images ]
path = / srv / mirrors / kali-images
comment = The Kali ISO images
read only = true
$ sudo service rsync start
Starting rsync daemon: rsync.

Configure Your Mirror

Configuration of your web server and FTP server are outside the scope of this article. Ideally, you should export the mirrors at http://yourmirror.net/kali and http://yourmirror.net/kali-images (and do the same for the FTP protocol, if you’re supporting it).

Now comes interesting part: the configuration of the dedicated user that will handle the SSH trigger and the actual mirroring. You should first unpack ftpsync.tar.gz in the user’s account:

Now we need to create a configuration file. We start from a template and we edit at least the MIRRORNAME, TO, RSYNC_PATH, and RSYNC_HOST parameters:

$ cp etc / ftpsync.conf.sample etc / ftpsync-kali.conf
$ vim etc / ftpsync-kali.conf
$ grep -E ‘^[^#]’ etc / ftpsync-kali.conf
MIRRORNAME = ` hostname -f `
TO = “/srv/mirrors/kali/”
RSYNC_PATH = “kali”
RSYNC_HOST =archive.kali.org

Set Up the SSH Keys

The last step is to setup the .ssh/authorized_keys file so that archive.kali.org can trigger your mirror:

If you have not unpacked the ftpsync.tar.gz in the home directory, then you must adjust accordingly the “~/bin/ftpsync” path, which is hard-coded in .ssh/authorized_keys.

Now you must send an email to devel@kali.org with all the URLs of your mirrors so that you can be added in the main mirror list and to open up your rsync access on archive.kali.org. Please indicate clearly who should be contacted in case of problems (or if changes must be made/coordinated to the mirror setup).

Instead of waiting for the first push from archive.kali.org, you should run an initial rsync with a mirror close to you, using the mirror list linked above to select one. Assuming that you picked archive-4.kali.org, here’s what you can run as your dedicated mirror user:

$ rsync -qaH archive- 4 .kali.org::kali / srv / mirrors / kali / &
$ rsync -qaH archive- 4 .kali.org::kali-images / srv / mirrors / kali-images / &

Set Up cron to Manually Mirror ISO Images

The ISO images repository does not use push mirroring so you must schedule a daily rsync run. We provide a bin/mirror-kali-images script, which is ready to use that you can add in the crontab of your dedicated user. You just have to configure etc/mirror-kali-images.conf.

$ sudo su – archvsync
$ cp etc / mirror-kali-images.conf.sample etc / mirror-kali-images.conf
$ vim etc / mirror-kali-images.conf
$ grep -E ‘^[^#]’ etc / mirror-kali-images.conf
TO = / srv / mirrors / kali-images /
$ crontab -e
$ crontab -l
# m h dom mon dow command
39 3 * * * ~ / bin / mirror-kali-images

Please adjust the precise time so that archive.kali.org doesn’t get overloaded by too many mirrors at the same time.

Источник

Как настроить зеркало Kali Linux

Использование простых последовательных шагов, предусмотренных в этом руководстве, вы можете настроить зеркало Kali Linux, которое может разместить основные репозитории Kali и изображения. Зеркало Kali Linux удобно.

Читайте также:  Основные сведения об операционной системе linux

Требования#

Чтобы создать полное зеркало Kali Linux, вам нужно будет иметь несколько ресурсов. К ним относятся:

  • Доступный веб-сервер с доступом HTTP и HTTPS
  • Большое дисковое пространство — как написание этого, по словам сопровождающих Kali Linux, хранилище пакета Kali Linux составляет 1,1 Терабайт и быстро растет
  • Услуги HTTP и RSYNC установлены и работают в системе

Настройте пользователь для зеркала Kali Linux#

Первый шаг — настроить полную учетную запись, посвященную только зеркалам Kali Linux. Используйте команду adduser :

$ adduser –disabled-password yourusername Adding user `yourusername’. Adding new group `yourusername’ (1001) . Adding new user `yourusername’ (1001) with group `yourusername’. Creating home directory `/home/yourusername' . Copying files from `/etc/skel' . Changing the user information for yourusername Enter the new value, or press ENTER for the default Full Name []: Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [Y/n] y 

Настройка зеркальных каталогов#

Далее нам нужно создать каталоги, которые содержат зеркала и назначить разрешения для пользователей, которые мы создали.

mkdir -p /srv/mirrors/kali chown yourusername:yourusername /srv/mirrors/kali

Приведенные выше команды создадут каталоги Kali и Kali-Images и устанавливают владение пользователю, которое мы создали ранее.

Настроить rsync#

Следующий шаг включает запуск и настройку службы rsync. Экспортируйте каталоги, используя команду:

sed -i -e "s/RSYNC_ENABLE=false/RSYNC_ENABLE=true/" /etc/default/rsync # nano /etc/rsyncd.conf # cat /etc/rsyncd.conf uid = nobody gid = nogroup max connections = 25 socket options = SO_KEEPALIVE [kali] path = /srv/mirrors/kali read only = true [kali-images] path = /srv/mirrors/kali-images read only = true # service rsync start Starting rsync daemon: rsync. 

Настройка ваших зеркал#

Далее нам нужно экспортировать зеркала по адресу http://domain.com/kali и http://domain.com/kalimages

Мы начинаем с загрузки и неархив http://chive.kali.org/ftpsync.tar.gz archive в каталоге пользователя, созданном ранее.

# su - archvsync # wget http://archive.kali.org/ftpsync.tar.gz # tar zxf ftpsync.tar.gz Next set up the configuration file. cp etc/ftpsync.conf.sample etc/ftpsync-kali.conf nano etc/ftpsync-kali.conf grep -E '^[^#]' etc/ftpsync-kali.conf MIRRORNAME=`hostname -f` TO="/srv/mirrors/kali/" RSYNC_PATH="kali" RSYNC_HOST=archive.kali.org 

Настройка доступа SSH#

Последний шаг — настроить авторизованные клавиши SSH для archive.kali.org, чтобы вызвать зеркало.

mkdir /home/yourusername/.ssh chown 700 /home/yourusername/.ssh wget –O- -q http://archive.kali.org/pushmirror.pub >> /home/yourusername/.ssh/authorized_keys chown 644 /home/yourusername/authorized_keys 

Связаться с Kali.org#

Как только вы закончите настроить свою систему, отправьте электронное письмо, предоставляя все детали для ваших зеркал, включая пользователь, порт для доступа к сервису SSH и общедоступное имя хоста. Вы также должны утверждать, кто Kali должен связаться с проблемами о проблемах, и если какие-либо изменения должны быть применены в соответствии с установкой зеркала.

Оттуда все, что вам нужно сделать, это ждать первого толчка из Archive.kali.org.

Источник

How to Setup a Kali Linux Mirror

Using the easy-to-follow steps provided in this guide, you can set up a Kali Linux mirror that can host Kali’s main repositories and images. A Kali Linux mirror is handy.

Requirements

To set up a complete Kali Linux mirror, you will need to have a few resources. These include:

  • An accessible web server with HTTP and HTTPs access
  • A large disk space—As of writing this, according to Kali Linux maintainers, the Kali Linux package repository is 1.1 TB and growing fast
  • HTTP and RSYNC services installed and running on the system
Читайте также:  What is hibernation linux

Set up a User for Kali Linux mirror

The first step is to set up a full account dedicated to kali Linux mirrors only. Use the adduser command:

$ adduser –disabled-password linuxhint

Adding new group ` linuxhint’ ( 1001 ) .

Adding new user ` linuxhint’ ( 1001 ) with group ` linuxhint’.

Creating home directory `/ home / linuxhint ‘ .

Copying files from `/etc/skel’ .

Changing the user information for linuxhint

Enter the new value, or press ENTER for the default

Is the information correct? [ Y / n ] y

Set up Mirror Directories

Next, we need to set up the directories that contain the mirrors and assign permissions to the user we’ve created.

mkdir -p / srv / mirrors / kali { ,-images }

chown linuxhint:linuxhint / srv / mirrors / kali { ,-images }

The commands above will create the directories kali and kali-images and set ownership to the user we created earlier.

Set up rsync

The next step involves starting and configuring rsync service. Export the directories using the command:

sed -i -e «s/RSYNC_ENABLE=false/RSYNC_ENABLE=true/» / etc / default / rsync

socket options = SO_KEEPALIVE

path = / srv / mirrors / kali

path = / srv / mirrors / kali-images

Starting rsync daemon: rsync.

Configuring your Mirrors

Next, we need to export the mirrors under http://domain.com/kali and http://domain.com/kali-images

We start by downloading and unarchiving the http://archive.kali.org/ftpsync.tar.gz archive in the user’s directory created earlier.

Next set up the configuration file.

cp etc / ftpsync.conf.sample etc / ftpsync-kali.conf

nano etc / ftpsync-kali.conf

grep -E ‘^[^#]’ etc / ftpsync-kali.conf

Configuring SSH Access

The final step is to configure SSH authorized keys for archive.kali.org to trigger the mirror.

mkdir / home / linuxhint / .ssh

chown 700 / home / linuxhint / .ssh

wget –O- -q http: // archive.kali.org / pushmirror.pub >> / home / linuxhint / .ssh / authorized_keys

chown 644 / home / linuxhint / authorized_keys

Contacting Kali.org

Once you have finished setting up your system, send an email to devel@kali.org providing all details for your mirrors, including the user, the port to access the SSH service, and public hostname. You should also state who Kali should contact in case of problems and if any changes should get applied according to the mirror setup.

From there, all you have to do is wait for the first push from archive.kali.org.

About the author

John Otieno

My name is John and am a fellow geek like you. I am passionate about all things computers from Hardware, Operating systems to Programming. My dream is to share my knowledge with the world and help out fellow geeks. Follow my content by subscribing to LinuxHint mailing list

Источник

Оцените статью
Adblock
detector