SUSE Manager/HostnameChange

From MicroFocusInternationalWiki
Jump to: navigation, search

SUSE Manager Main Page

Changing the server hostname


If this procedure breaks your server, you're on your own.

Some hints

After you changed the IP address and the hostname of the server, use the following hints to fix the CA certificate and to change the hostname in SUSE Manager.

Fixing CA certificate

In case you must also fix your CA cert because of a forgotten password, you could try:

Procedure for SUSE Manager version 1.7, 2.1

   /usr/bin/rhn-ssl-tool --gen-ca --password=<MY_CA_PASSWORD> --dir="/root/ssl-build" --set-state="North Carolina" \
     --set-city="Raleigh" --set-org="Example Inc" --set-org-unit="SSL CA Unit" --force --set-common-name="<MY_FQDN>"
   /usr/bin/ --source-dir /root/ssl-build --target-dir /srv/www/htdocs/pub/
   /usr/bin/rhn-ssl-tool --gen-server --password=<MY_CA_PASSWORD> --dir="/root/ssl-build" --set-state="North Carolina" \
     --set-city="Raleigh" --set-org="Example Inc." --set-org-unit="IS/IT" --set-email="" --set-hostname="<MY_FQDN>"
   /usr/bin/ --dir=/root/ssl-build/<MY_SHORT_HOSTNAME>
   /usr/bin/  --out-file=/etc/pki/spacewalk/jabberd/server.pem --ssl-dir=/root/ssl-build/<MY_SHORT_HOSTNAME>
   /usr/bin/rhn-ssl-dbstore --ca-cert=/root/ssl-build/RHN-ORG-TRUSTED-SSL-CERT
   cp /root/ssl-build/RHN-ORG-TRUSTED-SSL-CERT /usr/share/rhn/
   spacewalk-service restart

These commands will create a new certificate and update configuration files in the known places (please add others if you find them here). Of course you will later need to install the new certificate on all clients.

Renaming hostname command

Once the CA cert is fixed, run spacewalk-hostname-rename (found in spacewalk-utils package). This should finish with no errors and you're done.

More information about the spacewalk-hostname-rename can be found here

Manually changing the hostname

1. call `sysctl kernel.hostname=<HOSTNAME>` (to set the hostname temporarily in the kernel)
2. call `hostnamectl set-hostname <HOSTNAME>` (to set the hostname temporarily in userspace)
3. have the HOSTNAME in /etc/hostname
4. have the FQDN in /etc/HOSTNAME (for backwards compatibility)

At that point, assuming correct DNS configuration, the SUSE Manager Server is expected to have a fully-circle DNS name which is fully-qualified, and where the hostname matches the machine hostname.