Kali Linux

How to Setup a Kali Linux Mirror

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.

Let us get started.

Requirements

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

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 user '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
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
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
# 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.

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.

# 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

 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 [email protected] 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.

Cum se folosește Xdotool pentru a stimula clicurile și tastele mouse-ului în Linux
Xdotool este un instrument de linie de comandă gratuit și open source pentru simularea clicurilor și a apăsărilor de mouse. Acest articol va acoperi u...
Top 5 produse ergonomice pentru mouse de calculator pentru Linux
Utilizarea prelungită a computerului vă provoacă dureri la încheietura mâinii sau la degete? Suferați de articulații rigide și trebuie să vă dați mâin...
How to Change Mouse and Touchpad Settings Using Xinput in Linux
Most Linux distributions ship with “libinput” library by default to handle input events on a system. It can process input events on both Wayland and X...