linux centeros 7.4 modify the hostname

Change the hostname to server_3


1. Use the command to modify

hostnamectl set-hostname server_3

2. Modify the configuration file /etc/hostname

vi /etc/hostname

server_3
~                                                                                                                            
~                                                                                                                            
~                                                                                                                            
~                                                                                                                            
~                                                                                                                            
~                                                                                                                            
~                    

Restart to take effect

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325475429&siteId=291194637