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.

Microsoft Sculpt Touch Wireless Mouse Review
I recently read about the Microsoft Sculpt Touch wireless mouse and decided to buy it. After using it for a while, I decided to share my experience wi...
AppyMouse On-screen Trackpad and Mouse Pointer for Windows Tablets
Tablet users often miss the mouse pointer, especially when they are habitual to using the laptops. The touchscreen Smartphones and tablets come with m...
Middle mouse button not working in Windows 10
The middle mouse button helps you scroll through long webpages and screens with a lot of data. If that stops, well you will end up using the keyboard ...