How to register a system to Red Hat Satellite 5 during kickstart installation?
Environment
- Red Hat Enterprise Linux (RHEL) 7 system kickstart via Red Hat Satellite 5.6+
- Red Hat Enterprise Linux (RHEL) 4/5/6 system kickstart via Red Hat Satellite 5.x
- Kickstart
Issue
- How do I use
rhnreg_ksto automatically register my system with Satellite 5 server during kickstart installation?
- How to register a RHEL server to Red Hat Satellite 5 during kickstart installation?
- We have kickstart anaconda configured to install Red Hat Enterprise Linux servers, how can we automate the registration of new installed server to Red Hat Satellite 5.x server so as we can use
yumto install packages and get updates released by Red Hat? - How to register my RHEL workstation to Red Hat Satellite 5 while kickstarting the system?
- Is there any way to register system in kickstart's
postscript?
Resolution
Introduction to
rhnreg_ks
The rhnreg_ks command is a utility for registering a system with Red Hat Satallite 5.x. It is designed to be used in a non-interactive environment (a kickstart style install, for example). All the information can be specified on the command line or stdin. Generally this command is used when you have created an activation key and you want to register a system using a key.
Using Activation Keys
The syntax to use the `rhnreg_ks` command to register a system using an activation key is:
rhnreg_ks --activationkey=<activationkey>
The example below will register a system to Red Hat Satellite using the activation key 1-2b48feedf5b5a0e0609ae028d9275c93:
rhnreg_ks --profilename=my_rhel_system01 --activationkey=1-2b48feedf5b5a0e0609ae028d9275c93
Using Satellite Credentials
You can also specify `username`, `password`, and `profilename`. The example below will register a system to Satellite server with the profile name "`my_rhel_system01`", using a Satellite `username` of "myusername" whose password is "mypw1234".
rhnreg_ks --profilename=my_rhel_system01 --username=myusername --password=mypw1234
Note: If the Satellite username and password were entered on the command line they may have been saved in the shell's history. The shell's entire history can be cleared by running the command history -c. Its possible to remove a single line from the shell's history by running the command history -d <line>. The exact line in the shell's history can be found by simply running the history command. The clear command can be issued to clear the login credentials from the screen.
For more details on using activation keys in Satellite provisioning please see Satellite Documentation.
You can also refer to This content is not included.How do I create an activation key for automated registration of my Red Hat Enterprise Linux systems to RHN Classic or Red Hat Satellite?.
RHEL Systems Registration Guide
- This document is part of a collection covering RHEL System Registration.
- If this is not the right solution for your registration needs or;
- If you wish to make a different registration choice;
- then you can return to the RHEL Systems Registration Guide.
Red Hat Labs Registration Assistant
We also have an online tool to assist you in selecting the most appropriate registration technology for your system. If you would prefer to use this tool, please visit [https://access.redhat.com/labs/registrationassistant/](https://access.redhat.com/labs/registrationassistant/).
This solution has been reviewed for technical accuracy, optimized for search, and integrated with Product Documentation and/or Red Hat Access Labs. Much like when a software package is accepted upstream, this content has moved from the general KCS editing workflow into the responsibility of Customer Content Services as maintainers.