How To Register clients with SpaceWalk Server – CentOS / RHEL
This post is the third part of Spacewalk installation and configuration series. In the first two parts, we have gone through the installation of Spacewalk server and managing Spacewalk channels and repositories.
Article Series:
Install Spacewalk
How to Install SpaceWalk on CentOS 7 / RHEL 7
How to Install SpaceWalk on CentOS 6 / RHEL 6
Manage Spacewalk
Managing Channels and Repositories in Spacewalk
Register clients with SpaceWalk Server
In this tutorial, we will configure clients to take installation packages from the Spacewalk server by registering on Spacewalk server.
Environment
Client OS: CentOS Linux release 7.2.1511 (Core)
Hostname: client.itzgeek.local
IP Address: 192.168.1.20
Install Spacewalk client
Though the base repository has packages that are required for registering clients with Spacewalk server, we will configure Spacewalk client repo on the client machine to get the latest packages.
rpm -Uvh https://yum.spacewalkproject.org/2.7-client/RHEL/7/x86_64/spacewalk-client-repo-2.7-2.el7.noarch.rpm rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Install below packages.
yum -y install rhn-client-tools rhn-check rhn-setup rhnsd m2crypto yum-rhn-plugin
Install SpaceWalk’s certificate on your client machine to enable secure communication. Replace the Spacewalk server name and RPM version if required.
rpm -Uvh https://server.itzgeek.local/pub/rhn-org-trusted-ssl-cert-1.0-1.noarch.rpm
Make sure the client machine can connect to the Spacewalk server with hostname. Use /etc/hosts file or DNS server for resolving the hostname.
Register clients with SpaceWalk Server
It is recommended to use activation keys for registering and configuring client systems with Spacewalk server. Login to Spacewalk server and get an activation that we created in the previous tutorial.
Goto System >> Activation Keys.

On client system’s Terminal, run the following command to register it to the Spacewalk server.
rhnreg_ks --activationkey 1-b908cd891e78c7b90cc6000ee63c0ec5 --serverUrl https://server.itzgeek.local/XMLRPC
Once the above command is executed, goto Spacewalk console, and click on Systems. You will see our client system that we just registered with Spacewalk.

Click on client name. You will be taken to client summary page where you can see detailed information about the registered client (client.itzgeek.local). You can see that the client machine has been automatically subscribed to the base channel (itzgeek_centos7).

Modifying a client subscription (Optional)
If you want to make use of child channels (Ex. To install Nginx), enable the child channel (Nginx) of the base channel to get Nginx packages.
GUI Mode
Go to Systems >> <Your Client> >> Software >> Software Channels >> Software Channel Subscriptions.
OR
Click on Alter Subscription Channels on the client overview page.
Select the Child channels (Ex. nginx_centos7) and click Change Subscriptions.

Now, the client system is successfully subscribed to Nginx child channel.

Command Line Mode
You can also change channel subscription using command Line. To list subscribed channels, run.
rhn-channel -l
Output:
itzgeek_centos7
To list the available channels, run.
rhn-channel -L
Output:
Username: admin Password: nginx_centos7
Now, to subscribe to child channel, run.
rhn-channel -a -c nginx_centos7
You will have to enter username and password of Spacewalk server admin account.
Verify the subscription using the below command.
# rhn-channel -l
Output:
nginx_centos7 itzgeek_centos7
If you want to remove child channel subscriptions, the run the following command.
rhn-channel -r -c nginx_centos7
Install Packages using Spacewalk Server
Now, you can start to install or update packages from the Spacewalk server. Disable non-Spacewalk repositories to avoid packages being downloaded from internet.
To do that, run:
sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/*
To test, install Nginx package on the client machine.
yum install nginx
Sample output:
Loaded plugins: fastestmirror, rhnplugin This system is receiving updates from RHN Classic or Red Hat Satellite. Loading mirror speeds from cached hostfile * epel: kartolo.sby.datautama.net.id Resolving Dependencies --> Running transaction check ---> Package httpd.x86_64 0:2.4.6-67.el7.centos will be installed --> Processing Dependency: httpd-tools = 2.4.6-67.el7.centos for package: httpd-2.4.6-67.el7.centos.x86_64 --> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-67.el7.centos.x86_64 --> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-67.el7.centos.x86_64 --> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-67.el7.centos.x86_64 --> Running transaction check ---> Package apr.x86_64 0:1.4.8-3.el7 will be installed ---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed ---> Package httpd-tools.x86_64 0:2.4.6-67.el7.centos will be installed ---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================================= Package Arch Version Repository Size ================================================================================================= Installing: httpd x86_64 2.4.6-67.el7.centos itzgeek_centos7 2.7 M Installing for dependencies: apr x86_64 1.4.8-3.el7 itzgeek_centos7 103 k apr-util x86_64 1.5.2-6.el7 itzgeek_centos7 92 k httpd-tools x86_64 2.4.6-67.el7.centos itzgeek_centos7 87 k mailcap noarch 2.1.41-2.el7 itzgeek_centos7 31 k Transaction Summary ================================================================================================= Install 1 Package (+4 Dependent packages) Total download size: 3.0 M Installed size: 10 M Downloading packages: (1/5): apr-1.4.8-3.el7.x86_64.rpm | 103 kB 00:00:00 (2/5): apr-util-1.5.2-6.el7.x86_64.rpm | 92 kB 00:00:00 (3/5): httpd-2.4.6-67.el7.centos.x86_64.rpm | 2.7 MB 00:00:00 (4/5): httpd-tools-2.4.6-67.el7.centos.x86_64.rpm | 87 kB 00:00:00 (5/5): mailcap-2.1.41-2.el7.noarch.rpm | 31 kB 00:00:00 ------------------------------------------------------------------------------------------------- Total 8.3 MB/s | 3.0 MB 00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : apr-1.4.8-3.el7.x86_64 1/5 Installing : apr-util-1.5.2-6.el7.x86_64 2/5 Installing : httpd-tools-2.4.6-67.el7.centos.x86_64 3/5 Installing : mailcap-2.1.41-2.el7.noarch 4/5 Installing : httpd-2.4.6-67.el7.centos.x86_64 5/5 Verifying : httpd-2.4.6-67.el7.centos.x86_64 1/5 Verifying : mailcap-2.1.41-2.el7.noarch 2/5 Verifying : httpd-tools-2.4.6-67.el7.centos.x86_64 3/5 Verifying : apr-util-1.5.2-6.el7.x86_64 4/5 Verifying : apr-1.4.8-3.el7.x86_64 5/5 Installed: httpd.x86_64 0:2.4.6-67.el7.centos Dependency Installed: apr.x86_64 0:1.4.8-3.el7 apr-util.x86_64 0:1.5.2-6.el7 httpd-tools.x86_64 0:2.4.6-67.el7.centos mailcap.noarch 0:2.1.41-2.el7 Complete!
You can see that packages have been installed from Spacewalk base channel (itzgeek_centos7).
That’s All. You have successfully registered client systems with Spacewalk server for packages. I plan to cover more topics on Spacewalk server, stay tuned.