Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › Ubuntu Server, Can't change hostname....
New Posts  All Forums:Forum Nav:

Ubuntu Server, Can't change hostname....

post #1 of 4
Thread Starter 
I've been running Ubuntu for minecraft/syslog/apache server. As I SSH between these I wanted to change the hostname to its proper function.

So I changed ubuntu to appropriate name for each server under both /etc/hostname and hosts
Code:
sudo nano /etc/hostname
sudo nano /etc/hosts

Now its showing username (none)

I can roll back the snapshot, but for easy of use I'd like to change the hostnames. What am I doing wrong here? I did include _ in the name, does that not work in hostnames?
post #2 of 4
Thread Starter 
Solved. Cant use _ in name rolleyes.gif
post #3 of 4
Enshure that there's isn't any new line characters in /etc/hostname then run:
Code:
sudo /etc/init.d/hostname.sh
This works on Debian, should also work on Ubuntu.
aurora
(15 items)
 
node1
(16 items)
 
node2
(10 items)
 
CPUMotherboardGraphicsRAM
i7 4790k asus maximus vii impact MSI 980 4GB 2x 8GB Corsair Dominator 1866 
Hard DriveHard DriveHard DriveCooling
Samsung EVO 250gb (OS) OCZ Vertex 2 128 gb (VMs) WD RE4 2x 1TB RAID0 H105 
OSMonitorKeyboardPower
Windows 8.1 Pro Asus PG278Q Filco Ninja Majestouch-2 (browns) Corsair 760i 
CaseMouseMouse Pad
BitFenix Prodigy Razer Abyssus Razer Goliathus Control Ed 
CPUMotherboardGraphicsRAM
i5 2400s ASUS P8H67-M EVO none 16 gb adata 
Hard DriveHard DriveHard DriveHard Drive
samsung 840 pro 128gb crucial m4 128gb wd blue 750gb wd black 500gb 
Hard DriveHard DriveHard DriveCooling
wd re4 1tb wd red 3tb crucial mx100 512gb Corsair H80i 
OSMonitorPowerCase
Debian GNU/Linux none Corsair RM 550w Lian Li PC-V354B 
CPUMotherboardGraphicsRAM
i5 2400s ASUS P8H67-M EVO none 16 gb adata 
Hard DriveCoolingOSMonitor
1x 320 + 1x 750 + 1x 250 WD + 2x 250gb Seagate ... Noctua NH-U9B SE2 Debian GNU/Linux none 
PowerCase
Silverstone SST-ST50F-P 500w Lian Li PC-V354B 
  hide details  
Reply
aurora
(15 items)
 
node1
(16 items)
 
node2
(10 items)
 
CPUMotherboardGraphicsRAM
i7 4790k asus maximus vii impact MSI 980 4GB 2x 8GB Corsair Dominator 1866 
Hard DriveHard DriveHard DriveCooling
Samsung EVO 250gb (OS) OCZ Vertex 2 128 gb (VMs) WD RE4 2x 1TB RAID0 H105 
OSMonitorKeyboardPower
Windows 8.1 Pro Asus PG278Q Filco Ninja Majestouch-2 (browns) Corsair 760i 
CaseMouseMouse Pad
BitFenix Prodigy Razer Abyssus Razer Goliathus Control Ed 
CPUMotherboardGraphicsRAM
i5 2400s ASUS P8H67-M EVO none 16 gb adata 
Hard DriveHard DriveHard DriveHard Drive
samsung 840 pro 128gb crucial m4 128gb wd blue 750gb wd black 500gb 
Hard DriveHard DriveHard DriveCooling
wd re4 1tb wd red 3tb crucial mx100 512gb Corsair H80i 
OSMonitorPowerCase
Debian GNU/Linux none Corsair RM 550w Lian Li PC-V354B 
CPUMotherboardGraphicsRAM
i5 2400s ASUS P8H67-M EVO none 16 gb adata 
Hard DriveCoolingOSMonitor
1x 320 + 1x 750 + 1x 250 WD + 2x 250gb Seagate ... Noctua NH-U9B SE2 Debian GNU/Linux none 
PowerCase
Silverstone SST-ST50F-P 500w Lian Li PC-V354B 
  hide details  
Reply
post #4 of 4
also to note, you can use
hostname new-hostname
but its not persistent on reboot.
Alien Invasion
(12 items)
 
OC'in beast
(21 items)
 
StoreMaster9000
(11 items)
 
CPUMotherboardGraphicsRAM
AMD Threadripper 1950x Alienware Area-51 TR edition Radeon Pro Duo (aka R9 Fury x2) HyperX 32GB DDR4-2400 
Hard DriveHard DriveOSMonitor
Intel 600p NVME Samsung NVME Windows 10 RS3 Dell P4317Q 
KeyboardPowerCaseMouse
Cooler Master QuickFire Cherry Brown Dell 1500W Alienware Area-51 Logitech MX5500 
CPUMotherboardGraphicsGraphics
AMD FX-8350 (Vishera) Gigabyte GA-990XA AMD 285X (unreleased) AMD 285X (unreleased) 
RAMHard DriveHard DriveHard Drive
Mushkin Enhanced Blackline 8GB (996679) Western Digital WD10EALS 1TB Blue Corsair Force Series GT CSSD-F180GBGT-BK 180GB Intel 530 Series SSDSC2BW240A401 240GB 
Optical DriveCoolingCoolingCooling
Sony 20X Sata DVD-RW Scythe Mugen 2 rev B (3) Scythe Slip Stream SY1225SL12H-P Antec Tri-Cool 140mm 
CoolingCoolingOSMonitor
Antec Tri-Cool 120mm Scythe Ultra Kaze DFS123812-3000 Windows 7 Pro 64bit ASUS PA248Q 24.1" IPS 
KeyboardPowerCaseMouse
Coolermaster Storm QuickFire Stealth Cherry MX ... Antec Earthwatts EA-750 Antec 300 Logitech G5 
Mouse Pad
Steel Series Starcraft 2 Marine 
CPUMotherboardGraphicsRAM
Opteron 6386 SE TYAN S8236-IL el crappo onboard vga 48GB RDDR3-1600 ECC 
Hard DriveHard DriveHard DriveOS
Seagate IronWolf Intel 200G DC S3710 SATA SSD Seagate Pulsar.2 ST200FM0002 SAS SSD VMWare Esxi 6.0 + Freenas 9.10 
PowerCaseOther
550W 1RU Tyan Mellanox ConnectX-3 Dual 10G SFP+ 
  hide details  
Reply
Alien Invasion
(12 items)
 
OC'in beast
(21 items)
 
StoreMaster9000
(11 items)
 
CPUMotherboardGraphicsRAM
AMD Threadripper 1950x Alienware Area-51 TR edition Radeon Pro Duo (aka R9 Fury x2) HyperX 32GB DDR4-2400 
Hard DriveHard DriveOSMonitor
Intel 600p NVME Samsung NVME Windows 10 RS3 Dell P4317Q 
KeyboardPowerCaseMouse
Cooler Master QuickFire Cherry Brown Dell 1500W Alienware Area-51 Logitech MX5500 
CPUMotherboardGraphicsGraphics
AMD FX-8350 (Vishera) Gigabyte GA-990XA AMD 285X (unreleased) AMD 285X (unreleased) 
RAMHard DriveHard DriveHard Drive
Mushkin Enhanced Blackline 8GB (996679) Western Digital WD10EALS 1TB Blue Corsair Force Series GT CSSD-F180GBGT-BK 180GB Intel 530 Series SSDSC2BW240A401 240GB 
Optical DriveCoolingCoolingCooling
Sony 20X Sata DVD-RW Scythe Mugen 2 rev B (3) Scythe Slip Stream SY1225SL12H-P Antec Tri-Cool 140mm 
CoolingCoolingOSMonitor
Antec Tri-Cool 120mm Scythe Ultra Kaze DFS123812-3000 Windows 7 Pro 64bit ASUS PA248Q 24.1" IPS 
KeyboardPowerCaseMouse
Coolermaster Storm QuickFire Stealth Cherry MX ... Antec Earthwatts EA-750 Antec 300 Logitech G5 
Mouse Pad
Steel Series Starcraft 2 Marine 
CPUMotherboardGraphicsRAM
Opteron 6386 SE TYAN S8236-IL el crappo onboard vga 48GB RDDR3-1600 ECC 
Hard DriveHard DriveHard DriveOS
Seagate IronWolf Intel 200G DC S3710 SATA SSD Seagate Pulsar.2 ST200FM0002 SAS SSD VMWare Esxi 6.0 + Freenas 9.10 
PowerCaseOther
550W 1RU Tyan Mellanox ConnectX-3 Dual 10G SFP+ 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux, Unix
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › Ubuntu Server, Can't change hostname....