Re: How to change a machine name?

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: kitepilot@kitepilot.com
Date:  
To: Main PLUG discussion list
Subject: Re: How to change a machine name?
Joe, 'changing a name' can be a *CAN* of worms.
Do:
find /etc/ -type f -exec grep -l "$(hostname)" "{}" \;
and that will tell you all the files where the current hostname is
hardcoded.
Yes, it *DOES* get hardcoded in multiple places.

Now you can:
for FILE in $(find /etc/ -type f -exec grep -l "$(hostname)" "{}" \;);do
      sed -i.B4_HOSTNAME_CHANGE -e "s/$(hostname)/mynewname/g" "${FILE}"
done 


And finally:
hostname mynewname
That should do the trick, YMMV.
Free advice, can't sue me! :)

As for the IP, why do you want to change the IP?
There are multiple ways to accomplish that (persistently) and most depend on
the distro flavor.
You could even use your router for that purpose, but why?
ET



writes:

> What is the procedure to change the machine/system name?
>
> For example, one of my computer's names that appears at the prompt is:
> joe@joe-T60:~$
> I'd like to simplify it to just t60:
>
> Likewise, I'd like to change my other computers machine names to simpler
> names.
>
> Also, is it possible to change the ip addresses of one's computers and
> other devices; and if so, how can that be done?
>
>
>
> ---------------------------------------------------
> PLUG-discuss mailing list -
> To subscribe, unsubscribe, or to change your mail settings:
> http://lists.phxlinux.org/mailman/listinfo/plug-discuss

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.phxlinux.org/mailman/listinfo/plug-discuss