Ubuntu 修改hostname

查看本机信息

#阿里云服务器
root@server07:/# hostnamectl
   Static hostname: server07
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 8993d7ffbf946fedea8fa90d576efgf9
           Boot ID: d3d23e37ece740248a8fcfcc2f62e2f0
    Virtualization: kvm
  Operating System: Ubuntu 16.04.6 LTS
            Kernel: Linux 4.4.0-148-generic
      Architecture: x86-64

修改hostname

root@server07:/# vi /etc/hostname
root@server07:/# hostname images
root@server07:/# hostnamectl
   Static hostname: images
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 8993d7ffbf946fedea8fa90d576efgf9
           Boot ID: d3d23e37ece740248a8fcfcc2f62e2f0
    Virtualization: kvm
  Operating System: Ubuntu 16.04.6 LTS
            Kernel: Linux 4.4.0-148-generic
      Architecture: x86-64

你可能感兴趣的:(Ubuntu 修改hostname)