Once our Red Hat 7 system is installed, it should be registered at RHN using Subscription Manager in order to be able to get newest updates. If the server is placed in network behind firewall and outgoing traffic is blocked by firewall, the only reliable way of keeping our Red Hat 7 up-to-date is through proxy (if any exists).
Below we will show you in 2 simple steps, how to configure HTTP Proxy for Red Hat Subscription Manager and register Red Hat 7 with RHN in command line using HTTP Proxy:
1. Set HTTP Proxy for Red Hat Subscription Manager
Use the following syntax:
[root@tuxfixer ~]# subscription-manager config --server.proxy_hostname=(proxy_server_ip) --server.proxy_port=(proxy_server_port)
Example:
[root@tuxfixer ~]# subscription-manager config --server.proxy_hostname=85.254.112.20 --server.proxy_port=8080
2. Register Red Hat 7 using your Red Hat credentials and automatically attach Red Hat repository
Use the following syntax:
[root@tuxfixer ~]# subscription-manager register --username (your_username) --password (your_password) --auto-attach
Example:
[root@tuxfixer ~]# subscription-manager register --username name.surname@tuxfixer.com --password tuxfixer_sec_pass --auto-attach
The system has been registered with ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status: Subscribed
3. (Optional) Enable additional Red Hat Channels to obtain additional packages
Red Hat Optional Channel:
[root@tuxfixer ~]# subscription-manager repos --enable rhel-7-server-optional-rpms
Red Hat Extras Channel:
[root@tuxfixer ~]# subscription-manager repos --enable rhel-7-server-extras-rpms