Programming Tutorials

(追記) (追記ここまで)

How to change the virtual machine name in Azure

By: Jason in Cloud Tutorials on 2020年06月01日 [フレーム]

To change the hostname from an SSH terminal, follow these steps:

  1. Log in to your server via SSH using a user with root or sudo privileges.

  2. Open the file /etc/hostname in a text editor. For example:

    sudo nano /etc/hostname
    
  3. Replace the existing hostname with the new hostname that you want to set. Save and close the file.

  4. Open the file /etc/hosts in a text editor. For example:

    sudo nano /etc/hosts
    
  5. Find the line that contains the old hostname and replace it with the new hostname. Save and close the file.

  6. Reboot the server for the changes to take effect. You can do this by running the command:

    sudo reboot
    

After the reboot, your server will use the new hostname.




(追記) (追記ここまで)


Add Comment

JavaScript must be enabled for certain features to work
* Required information
1000

Comments

No comments yet. Be the first!
(追記) (追記ここまで)
(追記) (追記ここまで)

AltStyle によって変換されたページ (->オリジナル) /