How to modify hostname in Linux
How to modify hostname in Linux? In view of this problem, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.
Modify hostname
[root@centos7 ~] $hostnamectl set-hostname hadoop001 # use this command to take effect immediately and restart also takes effect [root@centos7 ~] $hostname # View hadoop001 [root@centos7 ~] $vim / etc/hosts # Edit the hosts file and add hostname [root@centos7 ~] $cat / etc/hosts # to 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 hadoop001::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 check 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 hadoop001::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
Password-free login
Scp id_rsa.pub lau@192.168.1.108:/home/lau/.ssh/pub_key# login user cd ~ / .ssh/cat pub_key > > authorized_keyschmod 600 / home/lau/.ssh/authorized_keys what is the Linux system Linux is a free to use and free dissemination of UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-thread and multi-CPU operating system Using Linux, you can run major Unix tools, applications, and network protocols.
This is the answer to the question about how to modify hostname in Linux. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.