Change Hostname for Linux Devices

Managing device names helps keep your directory organized. This article explains how to change a device's display name in the JumpCloud Admin Portal and use a command template to update the actual hostname on a Linux (Ubuntu) device to match.

Considerations:

  • During initial agent installation, the JumpCloud Device Name matches the device's local hostname.
  • After initial installation, changes to the local hostname don't automatically update the Device Name in JumpCloud, and vice versa. To ensure they match, you must manually edit the Device Name in the Admin Portal.
  • You can use a JumpCloud Command to update a device's local hostname and the JumpCloud Device Name simultaneously.

Changing the Device Display Name

To update the display name of an existing device in the Admin Portal:

  1. Log in to the JumpCloud Admin Portal.

Important:

If your data is stored outside of the US, check which login URL you should be using depending on your region, see JumpCloud Data Centers to learn more.

  1. Go to Device Management > Devices.
  2. Select the device you want to rename.
  3. On the Highlights tab, locate the Device Name field.
  4. Enter your new Display Name.
  5. Click Save.

Renaming the Linux Hostname via Command

To change the actual hostname on the local Ubuntu device to match your new display name, use the built-in JumpCloud command template.

Prerequisites: You need a valid JumpCloud API key from an administrator account to run this command. See JumpCloud APIs to learn more.

Note:

When renaming servers, use a Fully Qualified Domain Name (FQDN), such as host.domain.tld, appropriate for your network environment.

To run the rename command:

  1. From the Admin Portal, go to Device Management > Commands.
  2. Click + Command, then select Command From Template.
  3. Click the Linux tab and locate the template named Linux - Rename System HostName from JumpCloud, and click Configure.
  4. (Optional) Change the Name of the command.
  5. Verify that Type is set to Linux.
  6. In the Command script field, locate the line: API_KEY="YourReadOnlyAPIKey"
  7. Replace YourReadOnlyAPIKey with your valid API key.
  8. Ensure Launch Event is set to Run Manually.
  9. Go to the Devices tab and select the Linux device you want to rename.
  10. Click Save.
  11. Back on the main Commands list, locate your newly created command and click Run Now.
  12. After the command finishes, go to the Results tab and review the output to verify the hostname changed successfully.
Back to Top

Still Have Questions?

If you cannot find an answer to your question in our FAQ, you can always contact us.

Submit a Case