WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Change the hostname  (Read 5953 times)

Offline aug

  • Jr. Member
  • **
  • Posts: 74
Change the hostname
« on: March 30, 2016, 02:46:44 AM »
How can this done????

- i have edited /etc/hostname
 => nothing
- used sudo hostname xxx
 => changed hostname but after a reboot its reset to box

I both cases i had added /etc/hostname to .filetool.lst and executed filetool.sh -b before rebooting.


Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Change the hostname
« Reply #1 on: March 30, 2016, 02:58:28 AM »
Add host=xxx to /mnt/mmcblk0p1/cmdline.txt
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline aug

  • Jr. Member
  • **
  • Posts: 74
Re: Change the hostname
« Reply #2 on: March 30, 2016, 03:02:37 AM »
Hm.... can i do this on a running system?

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 402
Re: Change the hostname
« Reply #3 on: March 30, 2016, 03:37:37 AM »

Yes

Sent from my iPad using Tapatalk HD

Offline aug

  • Jr. Member
  • **
  • Posts: 74
Re: Change the hostname
« Reply #4 on: March 30, 2016, 03:57:43 AM »
but how???  mmcblk0p1 is empty after booting....

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Change the hostname
« Reply #5 on: March 30, 2016, 04:08:02 AM »
but how???  mmcblk0p1 is empty after booting....

Mount it
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline jncl

  • Newbie
  • *
  • Posts: 38
Re: Change the hostname
« Reply #6 on: March 30, 2016, 07:25:16 AM »
Hi aug,

  You can also change the hostname from box by editing the line which says
Code: [Select]
/usr/bin/sethostname box in
Code: [Select]
/opt/bootsync.sh and then running
Code: [Select]
filetool.sh -b to save the changes.

HTH
  Jon

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1063
Re: Change the hostname
« Reply #7 on: March 30, 2016, 08:14:37 AM »
Hi aug,

  You can also change the hostname from box by editing the line which says
Code: [Select]
/usr/bin/sethostname box in
Code: [Select]
/opt/bootsync.sh and then running
Code: [Select]
filetool.sh -b to save the changes.

HTH
  Jon

This method does not work with DHCP environments, unless you don't care if the router gets the correct hostname advertisement.

Setting it commandline is more reliable.

Offline onelife

  • Full Member
  • ***
  • Posts: 141
Re: Change the hostname
« Reply #8 on: January 19, 2018, 02:51:55 AM »
Hi all,

I know this is an old thread, but I'm trying to change the name that shows on the network? This is not the hostname from what I can see but perhaps the device name? How would you do that? I'm trying to define a unique name that if a user did a network "sniff" they would see the custom name. Any ideas :)

Thank you!

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Change the hostname
« Reply #9 on: January 19, 2018, 05:33:37 AM »
Hi onelife
... I'm trying to change the name that shows on the network? This is not the hostname from what I can see but perhaps the device name? ...
I think the hostname is what goes out on the network, and that defaults to  box. What name are you seeing?

Offline onelife

  • Full Member
  • ***
  • Posts: 141
Re: Change the hostname
« Reply #10 on: January 19, 2018, 07:03:27 AM »
At the moment I see "Raspberry" and "Raspberry Pi" on the network search. So perhaps this is linked to the vendor name? Or actual product name when you "search" on a network? That's the name I'm trying to update - That's if it's possible?

Thanks

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1063
Re: Change the hostname
« Reply #11 on: January 19, 2018, 10:40:52 AM »
Nothing in piCore is going to broadcast Raspberry pi.    If your sniffing and seeing raspberry pi, then that is your sniffing program converting the MAC address to a real vendor name. 

If you are using wireshark, then take a look here https://code.wireshark.org/review/gitweb?p=wireshark.git;a=blob_plain;f=manuf


Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Change the hostname
« Reply #12 on: January 19, 2018, 10:57:56 AM »
Hi Paul_123
Now it makes sense. It never occurred to me that Raspberry pi would have their own vendor code.

Offline sodface

  • Jr. Member
  • **
  • Posts: 90
Re: Change the hostname
« Reply #13 on: January 19, 2018, 12:18:26 PM »
onelife doesn't specify whether his pi is connected via WIFI or wired LAN.  I would guess the B8:27:EB OUI would only be applicable to wired interfaces (not USB ones though)?

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 402
Re: Change the hostname
« Reply #14 on: January 19, 2018, 01:32:04 PM »
I think the manufacturer for "B8:27:EB" is "Raspberry Pi Foundation" and this applies to wired and built-in wireless.