Skip to main content

How to rename Linux Hostname

CentOS:

Logon to server via putty
Type      vi /etc/hosts      Enter
Press     I
Rename machine and Press escape press Shift colon
Type   wq!      Enter
Type   vi /etc/sysconfig/network   enter
Press i
Rename machine and Press escape press Shift colon
Type   wq!      Enter
service network restart
chkconfig network on
If you want to reboot the server type    init  6
 
*****************************  
Ubuntu:
sudo vim /etc/hostname

Press     I
Rename machine and Press escape press Shift colon
Type   wq!      Enter
Sudo reboot


********************************************  

Comments

Popular posts from this blog

Installing Nagios 4 on Ubuntu 14 04 LTS

Create a list of local administrators with PowerShell

1.        Create folder :    C:\Temp 2.        Save a text file with the name servers.txt and add server names 3.        Create a .PS1 file with the name “ Get-LocalGroupMembers . ps1 ”with below PowerShell code: **********************************************************     [ CmdletBinding () ] Param (     [ Parameter (    ValueFromPipeline = $true ,                 ValueFromPipelineByPropertyName = $true                 ) ]     [ string []]     $ComputerName = $env:ComputerName ,     [ Parameter () ]     [ string ]     $LocalGroupName = "Administrators" ,   ...