How to modify the Linux system host name

Source: Internet
Author: User
Tags ossec

Complete the goal:

Modify the host name of the CentOS 7 system

Use the command:

Hostnamectl

[Email protected] ~]# Hostnamectl--Helphostnamectl [OPTIONS ...] COMMAND ...  Query or change system hostname. -H--help Show This Help--version Show package version--no-ask-password do not prompt forPassword-H--host=[[Email protected]]host Operate on remote HOST-M--machine=CONTAINER Operate on local CONTAINER--transient onlySettransient hostname--StaticOnlySet Statichostname--pretty onlySetpretty hostnamecommands:status Show current hostname settingsSet-hostname NAME SET system hostnameSet-icon-name name Set icon Name forHostSet-chassis NAME Set Chassis type forHostSet-deployment NAME Set Deployment Environment forHostSet-location NAME Set Location forHost

To permanently modify the hostname, you need to modify the static host name:

[Email protected] ~]# Hostnamectl--staticset-hostname ossec-server

or execute the command.

Set-hostname ossec-server

Finally, reboot a bit.

How to modify the Linux system host name

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.